You are here

public function ProtectionRule::toArray in User protect 8

Gets an array of all property values.

Return value

mixed[] An array of property values, keyed by property name.

Overrides ConfigEntityBase::toArray

File

src/Entity/ProtectionRule.php, line 223

Class

ProtectionRule
Defines the Protection rule entity.

Namespace

Drupal\userprotect\Entity

Code

public function toArray() {
  $properties = parent::toArray();
  $names = [
    'protections',
    'protectedEntityTypeId',
    'protectedEntityId',
  ];
  foreach ($names as $name) {
    $properties[$name] = $this
      ->get($name);
  }
  return $properties;
}