1 | <?php |
||
2 | |||
3 | namespace ByTIC\DataObjects\Tests\Fixtures\Models\Books; |
||
4 | |||
5 | use ByTIC\DataObjects\BaseDto; |
||
6 | use ByTIC\DataObjects\Behaviors\Timestampable\TimestampableTrait; |
||
7 | |||
8 | /** |
||
9 | * Class Book |
||
10 | * @package ByTIC\DataObjects\Tests\Fixtures\Models\Books |
||
11 | */ |
||
12 | class Book extends BaseDto |
||
13 | { |
||
14 | use TimestampableTrait; |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
15 | |||
16 | protected $name; |
||
17 | protected $title; |
||
18 | |||
19 | protected $casts = [ |
||
20 | 'published' => 'datetime' |
||
21 | ]; |
||
22 | |||
23 | public static $compiled = 0; |
||
24 | |||
25 | /** |
||
26 | * @param string $name |
||
27 | */ |
||
28 | public function setName(string $name) |
||
29 | { |
||
30 | $this->setPropertyValue('name', ucfirst($name)); |
||
31 | } |
||
32 | |||
33 | public function getName() |
||
34 | { |
||
35 | return $this->name; |
||
36 | } |
||
37 | |||
38 | public function getTitle() |
||
39 | { |
||
40 | return $this->title; |
||
41 | } |
||
42 | |||
43 | protected static function compileMutators() |
||
44 | { |
||
45 | static::$compiled++; |
||
46 | parent::compileMutators(); |
||
47 | } |
||
48 | } |
||
49 |