public function import(\SimpleXMLElement $sx) { if (isset($sx->pagetypecomposercontroltypes)) { foreach ($sx->pagetypecomposercontroltypes->type as $th) { $pkg = static::getPackageObject($th['package']); $ce = Type::add((string) $th['handle'], (string) $th['name'], $pkg); } } }
public function execute(Batch $batch) { $types = $batch->getObjectCollection('page_type_publish_target_type'); if (!$types) { return; } foreach ($types->getTypes() as $type) { if (!$type->getPublisherValidator()->skipItem()) { $pkg = false; if ($type->getPackage()) { $pkg = \Package::getByHandle($type->getPackage()); } \Concrete\Core\Page\Type\Composer\Control\Type\Type::add($type->getHandle(), $type->getName(), $pkg); } } }