public static function PathautoItem::propertyDefinitions in Pathauto 8
Defines field item properties.
Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().
Return value
\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.
Overrides PathItem::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- src/
PathautoItem.php, line 17
Class
- PathautoItem
- Extends the default PathItem implementation to generate aliases.
Namespace
Drupal\pathautoCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
$properties['pathauto'] = DataDefinition::create('integer')
->setLabel(t('Pathauto state'))
->setDescription(t('Whether an automated alias should be created or not.'))
->setComputed(TRUE)
->setClass('\\Drupal\\pathauto\\PathautoState');
return $properties;
}