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


PHP FieldItemBase::onChange方法代碼示例

本文整理匯總了PHP中Drupal\Core\Field\FieldItemBase::onChange方法的典型用法代碼示例。如果您正苦於以下問題:PHP FieldItemBase::onChange方法的具體用法?PHP FieldItemBase::onChange怎麽用?PHP FieldItemBase::onChange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Field\FieldItemBase的用法示例。


在下文中一共展示了FieldItemBase::onChange方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name)
 {
     parent::onChange($property_name);
     // Enforce that the computed date is recalculated.
     if ($property_name == 'value') {
         $this->date = NULL;
     }
 }
開發者ID:alnutile,項目名稱:drunatra,代碼行數:11,代碼來源:DateTimeItem.php

示例2: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name, $notify = TRUE)
 {
     // Unset processed properties that are affected by the change.
     foreach ($this->definition->getPropertyDefinitions() as $property => $definition) {
         if ($definition->getClass() == '\\Drupal\\text\\TextProcessed') {
             if ($property_name == 'format' || $definition->getSetting('text source') == $property_name) {
                 $this->writePropertyValue($property, NULL);
             }
         }
     }
     parent::onChange($property_name, $notify);
 }
開發者ID:nstielau,項目名稱:drops-8,代碼行數:15,代碼來源:TextItemBase.php

示例3: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name, $notify = TRUE)
 {
     // Enforce that the computed date is recalculated.
     if ($property_name == 'value') {
         $this->date = NULL;
     }
     parent::onChange($property_name, $notify);
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:11,代碼來源:DateTimeItem.php

示例4: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name, $notify = TRUE)
 {
     // Make sure that the target ID and the target property stay in sync.
     if ($property_name == 'entity') {
         $property = $this->get('entity');
         $target_id = $property->isTargetNew() ? static::$NEW_ENTITY_MARKER : $property->getTargetIdentifier();
         $this->writePropertyValue('target_id', $target_id);
     } elseif ($property_name == 'target_id' && $this->target_id != static::$NEW_ENTITY_MARKER) {
         $this->writePropertyValue('entity', $this->target_id);
     }
     parent::onChange($property_name, $notify);
 }
開發者ID:brstde,項目名稱:gap1,代碼行數:15,代碼來源:EntityReferenceItem.php

示例5: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name, $notify = TRUE)
 {
     // Make sure that the value and the language property stay in sync.
     if ($property_name == 'value') {
         $this->writePropertyValue('language', $this->value);
     } elseif ($property_name == 'language') {
         $this->writePropertyValue('value', $this->get('language')->getTargetIdentifier());
     }
     parent::onChange($property_name, $notify);
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:13,代碼來源:LanguageItem.php

示例6: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name)
 {
     // Make sure that the value and the language property stay in sync.
     if ($property_name == 'value') {
         $this->properties['language']->setValue($this->value, FALSE);
     } elseif ($property_name == 'language') {
         $this->set('value', $this->properties['language']->getTargetIdentifier(), FALSE);
     }
     parent::onChange($property_name);
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:13,代碼來源:LanguageItem.php

示例7: onChange

 /**
  * {@inheritdoc}
  */
 public function onChange($property_name)
 {
     // Make sure that the target ID and the target property stay in sync.
     if ($property_name == 'target_id') {
         $this->properties['entity']->setValue($this->target_id, FALSE);
     } elseif ($property_name == 'entity') {
         $this->set('target_id', $this->properties['entity']->getTargetIdentifier(), FALSE);
     }
     parent::onChange($property_name);
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:13,代碼來源:EntityReferenceItem.php


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