27 lines
614 B
PHP
27 lines
614 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
final class MotifModel extends BaseModel
|
|
{
|
|
public function allActive(): array
|
|
{
|
|
return $this->pdo->query(
|
|
"SELECT id_motif, code, libelle, compte_dans_quota
|
|
FROM motif_planning
|
|
WHERE actif = TRUE
|
|
ORDER BY ordre_affichage, libelle"
|
|
)->fetchAll();
|
|
}
|
|
|
|
public function activeIds(): array
|
|
{
|
|
return array_map(
|
|
'intval',
|
|
$this->pdo->query('SELECT id_motif FROM motif_planning WHERE actif = TRUE')->fetchAll(\PDO::FETCH_COLUMN)
|
|
);
|
|
}
|
|
}
|