public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->jobs)) {
         foreach ($sx->jobs->job as $jx) {
             $pkg = static::getPackageObject($jx['package']);
             $job = Job::getByHandle($jx['handle']);
             if (!is_object($job)) {
                 if (is_object($pkg)) {
                     Job::installByPackage($jx['handle'], $pkg);
                 } else {
                     Job::installByHandle($jx['handle']);
                 }
             }
         }
     }
 }
 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()
 {
     $job = Job::getByHandle($this->object->getHandle());
     return is_object($job);
 }