Skip to content
Snippets Groups Projects
Select Git revision
  • f2d38128bb43a0b983765be4e1ee197a254b9843
  • master default protected
  • b24
  • ll-session
  • ll-workflow
  • ll-framework
  • ll-wf-finitions
  • alc-scindage-donnees-pj
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • 24.11
  • 24.10
  • 24.9
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
41 results

php.conf

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ArrayContainer.php 1.01 KiB
    <?php
    
    namespace UnicaenAlerte\Container\Array;
    
    use UnicaenAlerte\Container\ContainerInterface;
    use UnicaenAlerte\Entity\Db\Alerte;
    
    /**
     * Container basique de type tableau permettant d'ajouter manuellement des alertes.
     */
    class ArrayContainer implements ContainerInterface
    {
        /**
         * Alertes à afficher.
         * @var Alerte[]
         */
        protected array $alertes = [];
    
        public function addAlerte(Alerte $alerte): self
        {
            $this->alertes[] = $alerte;
    
            return $this;
        }
    
        public function addAlerteNew(string $text,
                                     string $title,
                                     string $severity = Alerte::SEVERITY_INFO,
                                     int    $duration = 0): self
        {
            $alerte = Alerte::create(uniqid('ALERTE_'), $text, $title, $severity, $duration);
    
            return $this->addAlerte($alerte);
        }
    
        /**
         * @return array|\UnicaenAlerte\Entity\Db\Alerte[]
         */
        public function fetchAlertes(): array
        {
            return $this->alertes;
        }
    }