當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConfigEntityBase::__sleep方法代碼示例

本文整理匯總了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;
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:9,代碼來源:View.php

示例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;
 }
開發者ID:neeravbm,項目名稱:unify-d8,代碼行數:19,代碼來源:Page.php

示例3: __sleep

 /**
  * {@inheritdoc}
  */
 public function __sleep()
 {
     $vars = parent::__sleep();
     // Gathered contexts objects should not be serialized.
     unset($vars[array_search('contexts', $vars)]);
     return $vars;
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:10,代碼來源:PageVariant.php

示例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;
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:21,代碼來源:Page.php


注:本文中的Drupal\Core\Config\Entity\ConfigEntityBase::__sleep方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。