Inheritance: implements Sulu\Component\DocumentManager\Behavior\Mapping\NodeNameBehavior, implements Sulu\Component\Content\Document\Behavior\LocalizedStructureBehavior, implements Sulu\Component\Content\Document\Behavior\ResourceSegmentBehavior, implements Sulu\Component\Content\Document\Behavior\NavigationContextBehavior, implements Sulu\Component\Content\Document\Behavior\RedirectTypeBehavior, implements Sulu\Component\Content\Document\Behavior\WorkflowStageBehavior, implements Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior, implements Sulu\Component\DocumentManager\Behavior\Mapping\UuidBehavior, implements Sulu\Component\DocumentManager\Behavior\Mapping\ChildrenBehavior, implements Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior, implements Sulu\Component\Content\Document\Behavior\ExtensionBehavior, implements Sulu\Component\Content\Document\Behavior\OrderBehavior, implements Sulu\Component\Content\Document\Behavior\WebspaceBehavior, implements Sulu\Component\Content\Document\Behavior\SecurityBehavior, implements Sulu\Component\Content\Document\Behavior\LocalizedAuditableBehavior, implements Sulu\Component\DocumentManager\Behavior\Mapping\LocalizedTitleBehavior
Exemple #1
0
 /**
  * {@inheritdoc}
  *
  * @param BasePageDocument $object
  */
 public function setContext($object, $locale, array $context)
 {
     if (array_key_exists('template', $context)) {
         $object->setStructureType($context['template']);
     }
     return $object;
 }
Exemple #2
0
 /**
  * Returns a flat array with the settings of the given document.
  *
  * @param BasePageDocument $document
  * @param string $format
  *
  * @return array
  */
 protected function getSettingData(BasePageDocument $document, $format)
 {
     if ($created = $document->getCreated()) {
         $created = $created->format('c');
     }
     if ($changed = $document->getChanged()) {
         $changed = $changed->format('c');
     }
     if ($published = $document->getPublished()) {
         $published = $published->format('c');
     }
     $settingOptions = [];
     if ($format === '1.2.xliff') {
         $settingOptions = ['translate' => false];
     }
     return ['structureType' => $this->createProperty('structureType', $document->getStructureType(), $settingOptions), 'published' => $this->createProperty('published', $published, $settingOptions), 'created' => $this->createProperty('created', $created, $settingOptions), 'changed' => $this->createProperty('changed', $changed, $settingOptions), 'creator' => $this->createProperty('creator', $document->getCreator(), $settingOptions), 'changer' => $this->createProperty('changer', $document->getChanger(), $settingOptions), 'locale' => $this->createProperty('locale', $document->getLocale(), $settingOptions), 'navigationContexts' => $this->createProperty('navigationContexts', json_encode($document->getNavigationContexts()), $settingOptions), 'permissions' => $this->createProperty('permissions', json_encode($document->getPermissions()), $settingOptions), 'shadowLocale' => $this->createProperty('shadowLocale', $document->getShadowLocale(), $settingOptions), 'originalLocale' => $this->createProperty('originalLocale', $document->getOriginalLocale(), $settingOptions), 'resourceSegment' => $this->createProperty('resourceSegment', $document->getResourceSegment(), $settingOptions), 'webspaceName' => $this->createProperty('webspaceName', $document->getWebspaceName(), $settingOptions), 'redirectExternal' => $this->createProperty('redirectExternal', $document->getRedirectExternal(), $settingOptions), 'redirectType' => $this->createProperty('redirectType', $document->getRedirectType(), $settingOptions), 'redirectTarget' => $this->createProperty('redirectTarget', $document->getRedirectTarget(), $settingOptions), 'workflowStage' => $this->createProperty('workflowStage', $document->getWorkflowStage(), $settingOptions), 'path' => $this->createProperty('path', $document->getPath(), $settingOptions)];
 }