本文整理匯總了PHP中Drupal\Core\Config\Entity\ConfigEntityBase::__sleep方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigEntityBase::__sleep方法的具體用法?PHP ConfigEntityBase::__sleep怎麽用?PHP ConfigEntityBase::__sleep使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Config\Entity\ConfigEntityBase
的用法示例。
在下文中一共展示了ConfigEntityBase::__sleep方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __sleep
/**
* {@inheritdoc}
*/
public function __sleep()
{
$keys = parent::__sleep();
unset($keys[array_search('executable', $keys)]);
return $keys;
}
示例2: __sleep
/**
* {@inheritdoc}
*/
public function __sleep()
{
$vars = parent::__sleep();
// Avoid serializing plugin collections and the page executable as they
// might contain references to a lot of objects including the container.
$unset_vars = ['variants' => NULL, 'accessConditionCollection' => 'access_variants', 'executable' => NULL];
foreach ($unset_vars as $unset_var => $configuration_key) {
if (!empty($this->{$unset_var})) {
if ($configuration_key) {
$this->set($configuration_key, $this->{$unset_var}->getConfiguration());
}
unset($vars[array_search($unset_var, $vars)]);
}
}
return $vars;
}
示例3: __sleep
/**
* {@inheritdoc}
*/
public function __sleep()
{
$vars = parent::__sleep();
// Gathered contexts objects should not be serialized.
unset($vars[array_search('contexts', $vars)]);
return $vars;
}
示例4: __sleep
/**
* {@inheritdoc}
*/
public function __sleep()
{
$vars = parent::__sleep();
// Ensure any plugin collections are stored correctly before serializing.
// @todo Let https://www.drupal.org/node/2650588 handle this instead.
foreach ($this->getPluginCollections() as $plugin_config_key => $plugin_collection) {
$this->set($plugin_config_key, $plugin_collection->getConfiguration());
}
// Avoid serializing plugin collections and entities as they might contain
// references to a lot of objects including the container.
$unset_vars = ['variants', 'accessConditionCollection'];
foreach ($unset_vars as $unset_var) {
if (!empty($this->{$unset_var})) {
unset($vars[array_search($unset_var, $vars)]);
}
}
return $vars;
}