<?php

namespace App\Entities;

class OrderEntity extends BaseEntity
{

    protected $datamap = [];
    protected $dates   = ['created_at', 'updated_at', 'deleted_at'];
    protected $casts   = [];

    //기본기능
    final public function getTitle(): string
    {
        return $this->attributes['name'];
    }
    //추가기능
    public function getOrderHint()
    {
        $hints = explode("-", $this->getPrimaryKey());
        return sprintf(
            "%s-**-%s",
            str_split($hints[0], 3)[0],
            str_split($hints[count($hints) - 1], 5)[0]
        );
    }
}
