/**
* {@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)];
}