getContentTypeName() public method

returns name of content type.
public getContentTypeName ( ) : string
return string
Example #1
0
 /**
  * Returns parameters for given property merged wit default parameters.
  *
  * @param PropertyInterface $property
  *
  * @return array
  */
 public function getParamsFunction(PropertyInterface $property)
 {
     $typeParams = [];
     if ($this->contentTypeManager->has($property->getContentTypeName())) {
         $type = $this->getTypeFunction($property->getContentTypeName());
         $typeParams = $type->getDefaultParams($property);
     }
     return $this->mergeRecursive($typeParams, $property->getParams());
 }
Example #2
0
 private function getReferencedUuids(PropertyInterface $property)
 {
     $contentTypeName = $property->getContentTypeName();
     $contentType = $this->contentTypeManager->get($contentTypeName);
     $referencedUuids = $contentType->getReferencedUuids($property);
     return $referencedUuids;
 }
Example #3
0
 /**
  * returns name of content type.
  *
  * @return string
  */
 public function getContentTypeName()
 {
     return $this->property->getContentTypeName();
 }
Example #4
0
 /**
  * write a property to node.
  */
 private function writeProperty(PropertyInterface $property, PropertyInterface $blockProperty, $value, $index, NodeInterface $node, $userId, $webspaceKey, $languageCode, $segmentKey, $isImport = false)
 {
     // save sub property
     $contentType = $this->contentTypeManager->get($property->getContentTypeName());
     $blockPropertyWrapper = new BlockPropertyWrapper($property, $blockProperty, $index);
     $blockPropertyWrapper->setValue($value);
     if ($isImport && $contentType instanceof ContentTypeExportInterface) {
         return $contentType->importData(new SuluNode($node), $blockPropertyWrapper, $value, $userId, $webspaceKey, $languageCode, $segmentKey);
     }
     $contentType->write(new SuluNode($node), $blockPropertyWrapper, $userId, $webspaceKey, $languageCode, $segmentKey);
 }
Example #5
0
 /**
  * Prepare document-property and import them.
  *
  * @param PropertyInterface $property
  * @param NodeInterface $node
  * @param string $value
  * @param string $webspaceKey
  * @param string $locale
  * @param string $format
  */
 protected function importProperty(PropertyInterface $property, NodeInterface $node, StructureInterface $structure, $value, $webspaceKey, $locale, $format)
 {
     $contentType = $property->getContentTypeName();
     if (!$this->contentImportManager->hasImport($contentType, $format)) {
         return;
     }
     $translateProperty = $this->legacyPropertyFactory->createTranslatedProperty($property, $locale, $structure);
     $this->contentImportManager->import($contentType, $node, $translateProperty, $value, null, $webspaceKey, $locale);
 }
Example #6
0
 /**
  * write a property to node.
  */
 private function writeProperty(PropertyInterface $property, PropertyInterface $blockProperty, $index, NodeInterface $node, $userId, $webspaceKey, $languageCode, $segmentKey)
 {
     // save sub property
     $contentType = $this->contentTypeManager->get($property->getContentTypeName());
     $blockPropertyWrapper = new BlockPropertyWrapper($property, $blockProperty, $index);
     // TODO find a better why for change Types (same hack is used in ContentMapper:save )
     $contentType->remove($node, $blockPropertyWrapper, $webspaceKey, $languageCode, $segmentKey);
     $contentType->write($node, $blockPropertyWrapper, $userId, $webspaceKey, $languageCode, $segmentKey);
 }