public function createEmptyCollectionJob(\collection $collection)
    {
        $job = new EmptyCollectionJob($this->translator);
        $settings = simplexml_load_string($job->getEditor()->getDefaultSettings());
        $settings->bas_id = $collection->get_base_id();

        $task = new Task();
        $task->setName($job->getName())
            ->setJobId($job->getJobId())
            ->setSettings($settings->asXML())
            ->setPeriod($job->getEditor()->getDefaultPeriod());

        $this->om->persist($task);
        $this->om->flush();

        $this->notify(NotifierInterface::MESSAGE_CREATE);

        return $task;
    }
public function createEmptyCollectionJob(\collection $collection)
    {
        $job = new EmptyCollectionJob($this->translator);
        $settings = simplexml_load_string($job->getEditor()->getDefaultSettings());
        $settings->bas_id = $collection->get_base_id();

        $task = new Task();
        $task->setName($job->getName())
            ->setJobId($job->getJobId())
            ->setSettings($settings->asXML())
            ->setPeriod($job->getEditor()->getDefaultPeriod());

        $this->om->persist($task);
        $this->om->flush();

        $this->notify(NotifierInterface::MESSAGE_CREATE);

        return $task;
    }
public function createEmptyCollectionJob ( \ collection $ collection ) { $ job = new EmptyCollectionJob ( $ this -> translator ) ; $ settings = simplexml_load_string ( $ job -> getEditor ( ) -> getDefaultSettings ( ) ) ; $ settings -> bas_id = $ collection -> get_base_id ( ) ; $ task = new Task ( ) ; $ task -> setName ( $ job -> getName ( ) ) -> setJobId ( $ job -> getJobId ( ) ) -> setSettings ( $ settings -> asXML ( ) ) -> setPeriod ( $ job -> getEditor ( ) -> getDefaultPeriod ( ) ) ; $ this -> om -> persist ( $ task ) ; $ this -> om -> flush ( ) ; $ this -> notify ( NotifierInterface :: MESSAGE_CREATE ) ; return $ task ; }
Creates a EmptyCollection task given a collection

@param \collection $collection

@return Task
Creates a EmptyCollection task given a collection