/** * @param $id * @param $publishingEnabled * @param $publishData * @return \Cms\Data\Website */ protected function createWebsiteData($id, $publishingEnabled, $publishData) { $website = new \Cms\Data\Website(); $website->setId($id); $website->setName('this is the name of "' . $id . '"'); $website->setPublishingEnabled($publishingEnabled); $website->setPublish(json_encode($publishData)); return $website; }
/** * @param string $websiteId * @param array $navigation * * @return \Cms\Data\Website */ protected function createWebsiteDataObject($websiteId, $navigation) { $websiteData = new \Cms\Data\Website(); $websiteData->setId($websiteId); $websiteData->setNavigation(\json_encode($navigation)); return $websiteData; }
/** * @param $websiteCountWithPublishingEnabled * @param $websiteCountWithPublishingDisabled * * @return \Cms\Data\Website */ private function createTestWebsites($websiteCountWithPublishingEnabled, $websiteCountWithPublishingDisabled) { $publishingEnabledArray = array(); for ($i = 1; $i <= $websiteCountWithPublishingEnabled; $i++) { $publishingEnabledArray[] = true; } for ($i = 1; $i <= $websiteCountWithPublishingDisabled; $i++) { $publishingEnabledArray[] = false; } shuffle($publishingEnabledArray); $websites = array(); foreach ($publishingEnabledArray as $i => $isEnabled) { $website = new \Cms\Data\Website(); $website->setId('WEBSITE-ID-' . $i); $website->setName('publishingEnabled: ' . ($isEnabled ? 'yes' : 'no')); $website->setPublishingEnabled($isEnabled); $websites[] = $website; } return $websites; }
/** * Liefert ein CMS Datenobjekt zurueck mit den Werten des ORM Objektes * * @return \Cms\Data\Website */ public function toCmsData() { $dataObject = new \Cms\Data\Website(); $dataObject->setId($this->getId())->setShortId($this->getShortId())->setName($this->getName())->setDescription($this->getDescription())->setNavigation($this->getNavigation())->setColorscheme($this->getColorscheme())->setResolutions($this->getResolutions())->setVersion($this->getVersion())->setPublishingEnabled($this->getPublishingEnabled())->setPublish($this->getPublish())->setHome($this->getHome())->setUsedSetId($this->getUsedSetId())->setCreationMode($this->getCreationMode())->setMarkedForDeletion($this->isMarkedForDeletion())->setLastUpdate($this->getLastupdate()); return $dataObject; }