public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->jobsets)) {
         foreach ($sx->jobsets->jobset as $js) {
             $jso = Set::getByName((string) $js['name']);
             if (!is_object($jso)) {
                 $pkg = static::getPackageObject($js['package']);
                 if (is_object($pkg)) {
                     $jso = Set::add((string) $js['name'], $pkg);
                 } else {
                     $jso = Set::add((string) $js['name']);
                 }
             }
             foreach ($js->children() as $jsk) {
                 $j = Job::getByHandle((string) $jsk['handle']);
                 if (is_object($j)) {
                     $jso->addJob($j);
                 }
             }
         }
     }
 }
 public function execute(Batch $batch)
 {
     $sets = $batch->getObjectCollection('job_set');
     if (!$sets) {
         return;
     }
     foreach ($sets->getSets() as $set) {
         if (!$set->getPublisherValidator()->skipItem()) {
             $pkg = null;
             if ($set->getPackage()) {
                 $pkg = \Package::getByHandle($set->getPackage());
             }
             $set = \Concrete\Core\Job\Set::add($set->getName(), $pkg);
             $jobs = $set->getJobs();
             foreach ($jobs as $handle) {
                 $j = Job::getByHandle($handle);
                 if (is_object($j)) {
                     $set->addJob($j);
                 }
             }
         }
     }
 }
 public function skipItem()
 {
     $set = \Concrete\Core\Job\Set::getByName($this->object->getName());
     return is_object($set);
 }
Exemplo n.º 4
0
 public function setPropertiesFromArray($arr)
 {
     return parent::setPropertiesFromArray($arr);
 }