| Conditions | 4 |
| Paths | 4 |
| Total Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function query():array{ |
||
| 25 | $sql = sprintf('SELECT |
||
| 26 | lastname as name, |
||
| 27 | firstname as firstname, |
||
| 28 | email as email, |
||
| 29 | rowid as id |
||
| 30 | FROM llx_user |
||
| 31 | WHERE statut = 1 |
||
| 32 | AND firstname != \'\' |
||
| 33 | AND employee = 1 |
||
| 34 | ORDER BY lastname, firstname'); |
||
| 35 | |||
| 36 | $resql = $this->db->query($sql); |
||
| 37 | if (!$resql) { |
||
| 38 | return []; |
||
| 39 | } |
||
| 40 | |||
| 41 | $num = $this->db->num_rows($resql); |
||
| 42 | if ($num === 0) { |
||
| 43 | return []; |
||
| 44 | } |
||
| 45 | |||
| 46 | $pilots = []; |
||
| 47 | for($i = 0; $i < $num ; $i++) { |
||
| 48 | $pilots[] = Pilot::fromArray($this->db->fetch_array($resql)); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $pilots; |
||
| 52 | } |
||
| 53 | |||
| 54 | } |