pour prod
This commit is contained in:
26
app/Models/MotifModel.php
Normal file
26
app/Models/MotifModel.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user