public function execute(Batch $batch)
 {
     $types = $batch->getObjectCollection('workflow_type');
     if (!$types) {
         return;
     }
     foreach ($types->getTypes() as $type) {
         if (!$type->getPublisherValidator()->skipItem()) {
             $pkg = null;
             if ($type->getPackage()) {
                 $pkg = \Package::getByHandle($type->getPackage());
             }
             Type::add($type->getHandle(), $type->getName(), $pkg);
         }
     }
 }
 public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->workflowtypes)) {
         foreach ($sx->workflowtypes->workflowtype as $wt) {
             $pkg = static::getPackageObject($wt['package']);
             $name = $wt['name'];
             if (!$name) {
                 $name = \Core::make('helper/text')->unhandle($wt['handle']);
             }
             $type = \Concrete\Core\Workflow\Type::getByHandle((string) $wt['handle']);
             if (!is_object($type)) {
                 $type = \Concrete\Core\Workflow\Type::add($wt['handle'], $name, $pkg);
             }
         }
     }
 }
Beispiel #3
0
 protected function importWorkflowTypes(\SimpleXMLElement $sx)
 {
     if (isset($sx->workflowtypes)) {
         foreach ($sx->workflowtypes->workflowtype as $wt) {
             $pkg = static::getPackageObject($wt['package']);
             $name = $wt['name'];
             if (!$name) {
                 $name = Loader::helper('text')->unhandle($wt['handle']);
             }
             $type = \Concrete\Core\Workflow\Type::add($wt['handle'], $name, $pkg);
         }
     }
 }