1 | <?php |
||
21 | class SnapshotRecord extends Record |
||
22 | { |
||
23 | use TimestampsTrait; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | const DATABASE = 'snapshots'; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | const SCHEMA = [ |
||
34 | //primary fields |
||
35 | 'id' => 'primary', |
||
36 | 'suppression' => 'bool', |
||
37 | |||
38 | //exception teaser |
||
39 | 'exception_hash' => 'string', |
||
40 | |||
41 | //counters |
||
42 | 'count_occurred' => 'int', |
||
43 | |||
44 | //All occurred incidents before last one |
||
45 | 'incidents' => [ |
||
46 | self::HAS_MANY => IncidentRecord::class |
||
47 | ], |
||
48 | |||
49 | //Last occurred incident |
||
50 | 'last_incident' => [ |
||
51 | self::BELONGS_TO => IncidentRecord::class, |
||
52 | self::NULLABLE => true, |
||
53 | self::CREATE_CONSTRAINT => false |
||
54 | ] |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | const INDEXES = [ |
||
61 | [self::UNIQUE, 'exception_hash'], |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | const DEFAULTS = [ |
||
68 | 'suppression' => false |
||
69 | ]; |
||
70 | |||
71 | /** |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function isSuppressionEnabled(): bool |
||
78 | |||
79 | /** |
||
80 | * @param bool $suppression |
||
81 | */ |
||
82 | public function setSuppression(bool $suppression) |
||
86 | |||
87 | /** |
||
88 | * @return HasManyRelation |
||
89 | */ |
||
90 | public function getIncidentsHistory(): HasManyRelation |
||
94 | |||
95 | /** |
||
96 | * @return IncidentRecord|null |
||
97 | */ |
||
98 | public function getLastIncident() |
||
102 | |||
103 | /** |
||
104 | * @param IncidentRecord $incident |
||
105 | */ |
||
106 | public function pushIncident(IncidentRecord $incident) |
||
113 | |||
114 | /** |
||
115 | * Move last incident to history. |
||
116 | */ |
||
117 | public function archiveLastIncident() |
||
132 | |||
133 | /** |
||
134 | * Forget last incident. |
||
135 | */ |
||
136 | public function forgetLastIncident() |
||
140 | } |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.