Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface::getStructureMetadata PHP Method

getStructureMetadata() public method

Return the structure of the given $type and $structureType.
public getStructureMetadata ( mixed $type, mixed $structureType ) : StructureMetadata | null
$type mixed The primary system type, e.g. page, snippet
$structureType mixed The secondary user type
return Sulu\Component\Content\Metadata\StructureMetadata | null
    public function getStructureMetadata($type, $structureType);

Usage Example

コード例 #1
0
 /**
  * {@inheritdoc}
  *
  * This function wont work for website mode.
  * To enable this the object would have to loaded in case the argument $object is null.
  */
 public function getByEntity($entityClass, $id, $locale, $object = null)
 {
     $metadata = $this->structureMetadataFactory->getStructureMetadata('page', $object->getStructureType());
     return ['_controller' => $metadata->controller, 'view' => $metadata->view, 'object' => $object, 'structure' => $this->documentToStructure($object)];
 }