| 1 | <?php |
||
| 10 | class UserDAO extends DAO implements UserDAOInterface { |
||
| 11 | |||
| 12 | const TABLE = 'user'; |
||
| 13 | const ALIAS = 'Usuário'; |
||
| 14 | |||
| 15 | /** @var User */ |
||
| 16 | protected $obj; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param array $row |
||
| 20 | * @return User |
||
| 21 | */ |
||
| 22 | protected function mapObject($row) { |
||
| 23 | $obj = new User(); |
||
| 24 | if ($row) { |
||
|
|
|||
| 25 | $obj->setId($row['id']); |
||
| 26 | $obj->setEmail($row['email']); |
||
| 27 | $obj->setPass($row['pass']); |
||
| 28 | } |
||
| 29 | return $obj; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param User $obj |
||
| 34 | * @return mixed[] |
||
| 35 | */ |
||
| 36 | protected function mapRow($obj) { |
||
| 42 | |||
| 43 | public function fetchLast() { |
||
| 46 | |||
| 47 | } |
||
| 48 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.