robsonvleite /
datalayer
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Example\Models; |
||
| 4 | |||
| 5 | use CoffeeCode\DataLayer\DataLayer; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * Class Address |
||
| 9 | * @package Example\Models |
||
| 10 | */ |
||
| 11 | class Address extends DataLayer |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Address constructor. |
||
| 15 | */ |
||
| 16 | public function __construct() |
||
| 17 | { |
||
| 18 | parent::__construct("adresses", ["user_id"]); |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return $this |
||
| 23 | */ |
||
| 24 | public function getUser(): Address |
||
| 25 | { |
||
| 26 | $this->user = (new User())->findById($this->user_id)->data(); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
The property
user_id does not exist on Example\Models\Address. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 27 | return $this; |
||
| 28 | } |
||
| 29 | } |