当前位置: 首页>>代码示例>>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;未经允许,请勿转载。