public function AutoEntityLabelManager::autoLabelNeeded in Automatic Entity Label 8.3
Same name and namespace in other branches
- 8 src/AutoEntityLabelManager.php \Drupal\auto_entitylabel\AutoEntityLabelManager::autoLabelNeeded()
- 8.2 src/AutoEntityLabelManager.php \Drupal\auto_entitylabel\AutoEntityLabelManager::autoLabelNeeded()
Returns whether the automatic label has to be set.
Return value
bool Returns true if the label should be automatically generated.
Overrides AutoEntityLabelManagerInterface::autoLabelNeeded
File
- src/
AutoEntityLabelManager.php, line 201
Class
- AutoEntityLabelManager
- Class for Auto Entity Label Manager.
Namespace
Drupal\auto_entitylabelCode
public function autoLabelNeeded() {
$not_applied = empty($this->autoLabelApplied);
$required = $this
->hasAutoLabel();
$optional = $this
->hasOptionalAutoLabel() && empty($this->entity
->label());
return $not_applied && ($required || $optional);
}