You are here

public function CurrentPathDataDefinition::getPropertyDefinitions in Rules 8.3

Gets an array of property definitions of contained properties.

Return value

\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.

Overrides ComplexDataDefinitionBase::getPropertyDefinitions

File

src/TypedData/Type/CurrentPathDataDefinition.php, line 16

Class

CurrentPathDataDefinition
A typed data definition class for describing current_path data type.

Namespace

Drupal\rules\TypedData\Type

Code

public function getPropertyDefinitions() {
  if (!isset($this->propertyDefinitions)) {
    $this->propertyDefinitions['path'] = DataDefinition::create('string')
      ->setLabel('Path')
      ->setDescription('The current path.')
      ->setRequired(TRUE);
    $this->propertyDefinitions['url'] = DataDefinition::create('uri')
      ->setLabel('URL')
      ->setDescription('The current URL.')
      ->setRequired(TRUE);
  }
  return $this->propertyDefinitions;
}