/** * @param string $websiteId * @param string $id * @param SourceItem $sourceItem * @param \stdClass $manifest * @param string $previewImageUrl * * @return DataPageType */ protected function loadDataObject($websiteId, $id, SourceItem $sourceItem, \stdClass $manifest, $previewImageUrl) { $pageType = new DataPageType(); $pageType->setWebsiteid($websiteId); $pageType->setId($id); $pageType->setReadonly($sourceItem->isReadonly()); $pageType->setSourceType($sourceItem->getType()); $pageType->setSource($sourceItem); if (property_exists($manifest, 'name') && is_object($manifest->name)) { $pageType->setName($manifest->name); } if (property_exists($manifest, 'description') && is_object($manifest->description)) { $pageType->setDescription($manifest->description); } if (property_exists($manifest, 'version')) { $pageType->setVersion($manifest->version); } if (property_exists($manifest, 'form')) { $pageType->setForm($manifest->form); } if (property_exists($manifest, 'formValues')) { $pageType->setFormValues($manifest->formValues); } if (!empty($previewImageUrl)) { $pageType->setPreviewImageUrl($previewImageUrl); } return $pageType; }
/** * @param SourceItem $sourceItem * @param string $newId * @param string $subdirectory * * @return SourceItem */ public function createSubdirSourceItem(SourceItem $sourceItem, $newId, $subdirectory) { return new SourceItem($newId, FS::joinPath($sourceItem->getDirectory(), $subdirectory, $newId), $sourceItem->getUrl() . '/' . $subdirectory . '/' . $newId, $sourceItem->getType(), $sourceItem->isReadonly(), false); }
/** * @param SourceItem $sourceItem * * @throws ModuleNotWritable */ protected function checkIfModuleIsWritable(SourceItem $sourceItem) { if ($sourceItem->isReadonly()) { throw new ModuleNotWritable(114, __METHOD__, __LINE__, array('id' => $sourceItem->getId(), 'type' => $sourceItem->getType(), 'directory' => $sourceItem->getDirectory())); } }
/** * @param string $websiteId * @param string $id * @param SourceItem $sourceItem * @param \stdClass $manifest * @param string $lastUpdate * @param string $previewImageUrl * * @return DataTemplateSnippet */ protected function loadDataObject($websiteId, $id, SourceItem $sourceItem, \stdClass $manifest, $lastUpdate, $previewImageUrl) { $snippet = new DataTemplateSnippet(); $snippet->setWebsiteid($websiteId); $snippet->setId($id); $snippet->setReadonly($sourceItem->isReadonly()); $snippet->setSourceType($sourceItem->getType()); $snippet->setLastupdate($lastUpdate); if (!empty($previewImageUrl)) { $snippet->setPreviewImageUrl($previewImageUrl); } if (property_exists($manifest, 'name')) { $snippet->setName($manifest->name); } if (property_exists($manifest, 'description')) { $snippet->setDescription($manifest->description); } if (property_exists($manifest, 'category')) { $snippet->setCategory($manifest->category); } if (property_exists($manifest, 'content')) { $snippet->setContent($manifest->content); } if (property_exists($manifest, 'baseLayout')) { $snippet->setBaseLayout($manifest->baseLayout); } if (property_exists($manifest, 'pageTypes') && is_array($manifest->pageTypes)) { $snippet->setPageTypes($manifest->pageTypes); } return $snippet; }