本文整理匯總了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;
}