1 | <?php |
||
23 | abstract class AbstractAchieve implements |
||
24 | AchieveInterface, |
||
25 | SubscriberInterface, |
||
26 | Arrayable, |
||
27 | Jsonable |
||
28 | { |
||
29 | /** |
||
30 | * Achieve title |
||
31 | * @var string |
||
32 | */ |
||
33 | public $title = 'undefined'; |
||
34 | |||
35 | /** |
||
36 | * Achieve description |
||
37 | * @var string |
||
38 | */ |
||
39 | public $description = 'undefined'; |
||
40 | |||
41 | /** |
||
42 | * Achieve image link |
||
43 | * @var string |
||
44 | */ |
||
45 | public $image = '/img/achievements/karma-10.gif'; |
||
46 | |||
47 | /** |
||
48 | * @var null |
||
49 | */ |
||
50 | public $name = null; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $properties = []; |
||
56 | |||
57 | /** |
||
58 | * @constructor |
||
59 | */ |
||
60 | public function __construct() |
||
64 | |||
65 | /** |
||
66 | * @param User $user |
||
67 | * @param Carbon|null $createdAt |
||
68 | * @return Achieve |
||
69 | * @throws \LogicException |
||
70 | */ |
||
71 | public function create(User $user, Carbon $createdAt = null): Achieve |
||
81 | |||
82 | /** |
||
83 | * @param $key |
||
84 | * @param $value |
||
85 | */ |
||
86 | public function __set($key, $value) |
||
90 | |||
91 | /** |
||
92 | * @return array |
||
93 | */ |
||
94 | public function toArray(): array |
||
103 | |||
104 | /** |
||
105 | * @param int $options |
||
106 | * @return string |
||
107 | */ |
||
108 | public function toJson($options = 0): string |
||
112 | } |