public function AutoEntityLabelManager::autoLabelNeeded in Automatic Entity Label 8
Same name and namespace in other branches
- 8.3 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 171
Class
- AutoEntityLabelManager
- AutoEntityLabelManager class.
Namespace
Drupal\auto_entitylabelCode
public function autoLabelNeeded() {
$not_applied = empty($this->auto_label_applied);
$required = $this
->hasAutoLabel();
$optional = $this
->hasOptionalAutoLabel() && empty($this->entity
->label());
return $not_applied && ($required || $optional);
}