| 1 | <?php |
||
| 11 | class UserActiveRecordModel extends ActiveRecordModel implements UserStorageInterface |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string $tableName name of the database table. |
||
| 16 | */ |
||
| 17 | protected $tableName = "ramverk1_User"; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Columns in the table. |
||
| 21 | * |
||
| 22 | * @var integer $id primary key auto incremented. |
||
| 23 | */ |
||
| 24 | |||
| 25 | public $id; |
||
| 26 | public $username; |
||
| 27 | public $password; |
||
| 28 | public $email; |
||
| 29 | public $firstname; |
||
| 30 | public $lastname; |
||
| 31 | public $administrator; |
||
| 32 | public $enabled; |
||
| 33 | public $deleted; |
||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | /** |
||
| 38 | * Create user. |
||
| 39 | * |
||
| 40 | * @param User $user a user object. |
||
| 41 | * |
||
| 42 | * @return void |
||
| 43 | */ |
||
| 44 | 1 | public function createUser(User $user) |
|
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | /** |
||
| 53 | * Update user. |
||
| 54 | * |
||
| 55 | * @param User $user User object. |
||
| 56 | * |
||
| 57 | * @return void |
||
| 58 | */ |
||
| 59 | 2 | public function updateUser(User $user) |
|
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | /** |
||
| 69 | * Delete user. |
||
| 70 | * |
||
| 71 | * @param integer $id integer for userid. |
||
| 72 | * |
||
| 73 | * @return void |
||
| 74 | */ |
||
| 75 | 2 | public function deleteUser($id) |
|
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | /** |
||
| 87 | * Dynamicly set user properties to its value. |
||
| 88 | * |
||
| 89 | * @param User $user user object |
||
| 90 | */ |
||
| 91 | 3 | public function setUserData(User $user) |
|
| 101 | |||
| 102 | |||
| 103 | |||
| 104 | /** |
||
| 105 | * Dynamicly get user by field. |
||
| 106 | * |
||
| 107 | * @param string $field Fieldname to search. |
||
| 108 | * |
||
| 109 | * @param mixed $data Data to search for in the field. |
||
| 110 | * |
||
| 111 | * @return User Returns a user. |
||
| 112 | */ |
||
| 113 | 10 | public function getUserByField($field, $data) |
|
| 117 | |||
| 118 | |||
| 119 | |||
| 120 | /** |
||
| 121 | * Returns all users stored and that are not deleted. |
||
| 122 | * |
||
| 123 | * @return array Array with all users. |
||
| 124 | */ |
||
| 125 | 2 | public function findAllUsers() |
|
| 135 | } |
||
| 136 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: