本文整理汇总了PHP中Drupal\Core\Config\Entity\ConfigEntityBase::toArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigEntityBase::toArray方法的具体用法?PHP ConfigEntityBase::toArray怎么用?PHP ConfigEntityBase::toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Config\Entity\ConfigEntityBase
的用法示例。
在下文中一共展示了ConfigEntityBase::toArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toArray
/**
* {@inheritdoc}
*/
public function toArray()
{
$properties = parent::toArray();
// The 'roles' property is only used during install and should never
// actually be saved.
unset($properties['roles']);
return $properties;
}
示例2: toArray
/**
* {@inheritdoc}
*/
public function toArray()
{
$properties = parent::toArray();
$names = array('protections', 'protectedEntityTypeId', 'protectedEntityId');
foreach ($names as $name) {
$properties[$name] = $this->get($name);
}
return $properties;
}
示例3: testToArrayFallback
/**
* @covers ::toArray
*
* @expectedException \Drupal\Core\Config\Schema\SchemaIncompleteException
*/
public function testToArrayFallback()
{
$this->entityType->expects($this->any())->method('getPropertiesToExport')->willReturn([]);
$this->entity->toArray();
}
示例4: testToArrayFallback
/**
* @covers ::toArray
*
* @expectedException \Drupal\Core\Config\Schema\SchemaIncompleteException
*/
public function testToArrayFallback()
{
$this->entity->toArray();
}
示例5: toArray
/**
* {@inheritdoc}
*/
public function toArray()
{
$properties = parent::toArray();
// Do not store options for fields whose display is not set to be
// configurable.
foreach ($this->getFieldDefinitions() as $field_name => $definition) {
if (!$definition->isDisplayConfigurable($this->displayContext)) {
unset($properties['content'][$field_name]);
unset($properties['hidden'][$field_name]);
}
}
return $properties;
}
示例6: toArray
/**
* {@inheritdoc}
*/
public function toArray()
{
// @todo It's a bug that we have to do this. Backend configuration should
// always be set via the server's setBackendConfiguration() method,
// otherwise the two can diverge causing this and other problems. The
// alternative would be to call $server->setBackendConfiguration() in the
// backend's setConfiguration() method and use a second $propagate
// parameter to avoid an infinite loop. Similar things go for the index's
// various plugins. Maybe using plugin bags is the solution here?
$properties = parent::toArray();
if ($this->hasValidBackend()) {
$properties['backend_config'] = $this->getBackend()->getConfiguration();
}
return $properties;
}
示例7: toArray
/**
* {@inheritdoc}
*/
public function toArray()
{
$properties = parent::toArray();
// Additionally, include the field type, that is needed to be able to
// generate the field-type-dependant parts of the config schema and to
// allow for mapping settings from storage by field type.
// @see \Drupal\field\FieldInstanceConfigStorage::mapFromStorageRecords().
$properties['field_type'] = $this->getType();
return $properties;
}
示例8: toArray
/**
* {@inheritdoc}
*/
public function toArray()
{
$properties = parent::toArray();
$names = ['id', 'label', 'path', 'display_variants', 'access_conditions', 'access_logic', 'use_admin_theme', 'static_context'];
foreach ($names as $name) {
$properties[$name] = $this->get($name);
}
return $properties;
}