Commit 4f3a8b33 authored by Johnny Leveneur's avatar Johnny Leveneur
Browse files

page atelier trie des sessions sur la date de la 1ere séance

parent cf7ae2bc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ dufour221 [pas de mail]

-- view OCTO.V_INSC_SUAC_VILLE

-- create view OCTO.V_INSC_SUAC_VILLE as
select distinct isa.ville_code as id, isa.ville_nom as nom
from OCTO.IMMOBILIER_SITE_ADRESSE isa
where isa.ville_code is not null
@@ -22,7 +23,7 @@ and isa.ville_nom != 'Luc-sur-Mer' and isa.ville_nom != 'Villers-Bocage'
;

-- create view OCTO.V_INSC_SUAC_SITE as
select im.id, isa.ville_code as ville_id, im.LIBELLE_COMMUNICATION as libelle
select im.id, isa.ville_code as ville_id, im.LIBELLE_COURT as libelle
from immobilier_site im
         left join OCTO.IMMOBILIER_SITE_ADRESSE isa on im.id = isa.SITE_ID
where im.HISTO_DESTRUCTION is null
+8 −1
Original line number Diff line number Diff line
@@ -75,7 +75,14 @@ class Atelier implements HistoriqueAwareInterface
    /** @return Session[] */
    public function getSessions(): array
    {
        return $this->sessions->toArray();
        $sorted =  $this->sessions->toArray();
        usort($sorted, function (Session $a, Session $b) {
            $da = $a->getPremiereSeance()?->getDateTimeDebut() ?? PHP_INT_MAX;
            $db = $b->getPremiereSeance()?->getDateTimeDebut() ?? PHP_INT_MAX;
            return $da <=> $db;
        });

        return $sorted ;
    }

    public