public function EntityReference::isTargetNew in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php \Drupal\Core\Entity\Plugin\DataType\EntityReference::isTargetNew()
Checks whether the target entity has not been saved yet.
Return value
bool TRUE if the entity is new, FALSE otherwise.
File
- core/
lib/ Drupal/ Core/ Entity/ Plugin/ DataType/ EntityReference.php, line 64 - Contains \Drupal\Core\Entity\Plugin\DataType\EntityReference.
Class
- EntityReference
- Defines an 'entity_reference' data type.
Namespace
Drupal\Core\Entity\Plugin\DataTypeCode
public function isTargetNew() {
// If only an ID is given, the reference cannot be a new entity.
return !isset($this->id) && isset($this->target) && $this->target
->getValue()
->isNew();
}