shoppingmallv2/app/Entities/BillingEntity.php
2023-08-16 19:28:01 +09:00

32 lines
752 B
PHP

<?php
namespace App\Entities;
class BillingEntity extends BaseEntity
{
protected $datamap = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [];
//기본기능
final public function getTitle(): string
{
return $this->attributes['title'];
}
//추가기능
//파일관련 Field전용
final public function getFileDownload($url, $field = "upload_file")
{
if (is_null($this->attributes[$field])) {
return "";
}
$files = explode(DEFAULTS['DELIMITER_FILE'], $this->attributes[$field]);
return anchor(
$url,
ICONS['IMAGE_FILE'] . $files[0],
["target" => "_self"]
);
}
}