clear : Permet de supprimer l'association des jeux et des conditions à une mission
@param Mission $mission
343221
public function clear($mission)
    {
        $missionGames = $this->findMissionGameByMission($mission);
        foreach ($missionGames as $missionGames) {
            $this->getMissionGameMapper()->remove($missionGames);
        }
    }
243383
public function dispatch(Message $message): void
    {
        $this->messages[] = $message;

        // Add message to debug log.
        $context = $message->context ?? [];
        $this->logger->debug($message->message, $context);
    }
194334
protected function sendMessage(Message $message) {
		if(!$this->isIgnored($message)) {
			parent::sendMessage($message);
			$this->sentMessages[] = $message;
		}
	}
778555
final protected function flock($operation = LOCK_EX)
	{
		if ($operation === LOCK_EX or $operation == LOCK_SH) {
			$this->flocked = true;
		} else {
			$this->flocked = false;
		}
	}
314388
@Override
    public void install(MissionInit missionInit)
    {
        // In order to trigger the end of the mission, we need to hook into the quit handlers.
        MissionBehaviour mb = parentBehaviour();
        mb.addQuitProducer(new IWantToQuit()
        {
            @Override
            public void prepare(MissionInit missionInit)
            {
            }

            @Override
            public String getOutcome()
            {
                return MissionQuitCommandsImplementation.this.quitcomParams.getQuitDescription();
            }

            @Override
            public boolean doIWantToQuit(MissionInit missionInit)
            {
                return MissionQuitCommandsImplementation.this.iWantToQuit;
            }

            @Override
            public void cleanup()
            {
            }
        });
    }
660818
public function removeMissingSuites($suites, $project)
    {
        Suite::where('project_id', $project->id)->whereNotIn('name', collect($suites)->keys())->each(function ($suite) {
            $suite->delete();
        });
    }
691169
protected function addCriteriaToPositionQuery($query)
    {
        $contents = ContentFolderQuery::create()
            ->filterByFolderId($this->getDefaultFolderId())
            ->filterByDefaultFolder(true)
            ->select('content_id')
            ->find();

        // Filtrer la requete sur ces produits
        if ($contents != null) {
            $query->filterById($contents, Criteria::IN);
        }
    }
1030248
private function removeDeletedPermissions(array $permission): void
    {
        $configActions = collect($permission['actions']);

        $actions = $this->permissionRepository->makeQuery()->where('name', $permission['name'])->pluck('action');

        $removedActions = $actions->diff($configActions);

        if ($removedActions->isNotEmpty()) {
            foreach ($removedActions as $action) {
                $this->permissionRepository->deletePermission($action);
            }
        }
    }
484057
protected function note(...$message): void
    {
        if ($this->notice instanceof Notice) {
            $this->notice->add($message);
        }
    }
628688
private function whereFamily(bool $fams, Builder $query): void
    {
        if ($fams) {
            $query->join('link', static function (JoinClause $join): void {
                $join
                    ->on('l_from', '=', 'n_id')
                    ->on('l_file', '=', 'n_file')
                    ->where('l_type', '=', 'FAMS');
            });
        }
    }
259466
public function linkToMany($model, $link): void
    {
        Relations::setRelations($this->model, $model, [$link]);
    }
545213
public function log($level, $message, array $context = array())
    {
        // On ne logge qu'en fonction du niveau souhaité
        if (self::getLevelAsInt($level) <= self::getLevelAsInt($this->level)) {
            $myMsg = \FreeFW\Tools\PBXString::parse($message, $context);
            $this->write($myMsg, $level);
        }
        if ($level >= \Psr\Log\LogLevel::ERROR) {
            // send alert to monitoring...
            // APP_NAME, server name, broker...
        }
    }
1117837
public static function addMessageIfNotEmpty($message,$condition,$label='INFO'){
		if ( empty($condition)===false ) {
			self::debugbar()->addMessage($message,$label);
		}
	}
1069376
public function logMessage(Message $message) {
        foreach($this->logger as $logger) {
            $logger->logMessage($message);
        }
    }
737103
public function preUp(Schema $schema)
    {
        /** @var ManagerRegistry $doctrine */
        $doctrine = $this->container->get('doctrine');
        $em = $doctrine->getManager();

        // Get all Campaigns.
        $campaigns = $em->getRepository('CampaignChain\CoreBundle\Entity\Campaign')
            ->findAll();

        if($campaigns){
            try {
                $em->getConnection()->beginTransaction();

                /** @var Campaign $campaign */
                foreach($campaigns as $campaign){
                    /** @var Action $firstAction */
                    $firstAction = $em->getRepository('CampaignChain\CoreBundle\Entity\Campaign')
                        ->getFirstAction($campaign);
                    if($firstAction && $firstAction->getStartDate() < $campaign->getStartDate()){
                        $campaign->setStartDate($firstAction->getStartDate());
                        $em->persist($campaign);

                        $this->write(
                            'Changed start date of campaign "'.
                            $campaign->getName().'" ('.$campaign->getId().') '.
                            'to date "'.
                            $campaign->getStartDate()->format(\DateTime::ISO8601)
                        );
                    } else {
                        $this->write(
                            'No changes to campaign "'.
                            $campaign->getName().'" ('.$campaign->getId().').'
                        );
                    }
                }

                $em->flush();

                $em->getConnection()->commit();
            } catch (\Exception $e) {
                $em->getConnection()->rollback();
                $this->write($e->getMessage());
            }
        }
    }
902401
protected function clear_message_cache($folder = null, $uids = null)
    {
        if ($mcache = $this->get_mcache_engine()) {
            $mcache->clear($folder, $uids);
        }
    }
508811
private function _log($level, $message)
    {
        $level_config = Config::get("log_level");
        if (!$level_config) {
            $level_config = "DEBUG";
        }

        $level_val = self::$levels[$level];
        $level_config = self::$levels[$level_config];

        if ($level_config > $level_val) {
            return ;
        }

        wlog($level, $message);
    }