| 1 | <?php |
||
| 17 | class UserInvitation extends Model implements Stateful |
||
| 18 | { |
||
| 19 | use StatefulTrait, RevisionableTrait; |
||
| 20 | |||
| 21 | public static function boot() |
||
| 25 | |||
| 26 | /** |
||
| 27 | * The attributes that are mass assignable. |
||
| 28 | * |
||
| 29 | * @var array |
||
| 30 | */ |
||
| 31 | protected $fillable = ['email','state','token']; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Enable revisions on create. |
||
| 35 | * |
||
| 36 | * @var array |
||
| 37 | */ |
||
| 38 | protected $revisionCreationsEnabled = true; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Transaction States |
||
| 42 | * |
||
| 43 | * @var array |
||
| 44 | */ |
||
| 45 | protected $states = [ |
||
| 46 | 'pending' => ['initial' => true], |
||
| 47 | 'accepted' => ['final' => true] |
||
| 48 | ]; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Transaction State Transitions |
||
| 52 | * |
||
| 53 | * @var array |
||
| 54 | */ |
||
| 55 | protected $transitions = [ |
||
| 56 | 'accept' => [ |
||
| 57 | 'from' => ['pending'], |
||
| 58 | 'to' => 'accepted' |
||
| 59 | ] |
||
| 60 | ]; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Set the initial state. |
||
| 64 | * |
||
| 65 | * @return void |
||
| 66 | */ |
||
| 67 | public function setInitialState() |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Get the user record associated with the invitation. |
||
| 75 | */ |
||
| 76 | public function user() |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return bool |
||
| 83 | */ |
||
| 84 | protected function validateAccept() |
||
| 89 | } |
||
| 90 | |||
| 91 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.