/** * {@inheritdoc} */ public function onChange($property_name) { parent::onChange($property_name); // Enforce that the computed date is recalculated. if ($property_name == 'value') { $this->date = NULL; } }
/** * {@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); }
/** * {@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); }
/** * {@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); }
/** * {@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); }
/** * {@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); }
/** * {@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); }