src/Newsletter/Worker/CampagneWorker.php
public function arretsToHide($newsletter_id = null)
    {
        $campagnes = $this->campagne->getAll($newsletter_id)->where('status','brouillon');

        return $campagnes->flatMap(function ($campagne) {
                return $campagne->content;
            })->map(function ($content, $key) {

                if($content->arret_id)
                    return $content->arret_id ;

                if($content->groupe_id > 0)
                    return $content->groupe->arrets->pluck('id')->all();
            
            })->filter(function ($value, $key) {
                return !empty($value);
            })->flatten()->toArray();
    }
public function arretsToHide($newsletter_id = null)
    {
        $campagnes = $this->campagne->getAll($newsletter_id)->where('status','brouillon');

        return $campagnes->flatMap(function ($campagne) {
                return $campagne->content;
            })->map(function ($content, $key) {

                if($content->arret_id)
                    return $content->arret_id ;

                if($content->groupe_id > 0)
                    return $content->groupe->arrets->pluck('id')->all();
            
            })->filter(function ($value, $key) {
                return !empty($value);
            })->flatten()->toArray();
    }
public function arretsToHide ( $ newsletter_id = null ) { $ campagnes = $ this -> campagne -> getAll ( $ newsletter_id ) -> where ( 'status' , 'brouillon' ) ; return $ campagnes -> flatMap ( function ( $ campagne ) { return $ campagne -> content ; } ) -> map ( function ( $ content , $ key ) { if ( $ content -> arret_id ) return $ content -> arret_id ; if ( $ content -> groupe_id > 0 ) return $ content -> groupe -> arrets -> pluck ( 'id' ) -> all ( ) ; } ) -> filter ( function ( $ value , $ key ) { return ! empty ( $ value ) ; } ) -> flatten ( ) -> toArray ( ) ; }
Interaction with site controllers
List of arrets in non sent campagne to hide on frontend
Interaction with site controllers List of arrets in non sent campagne to hide on frontend