You are here

public function ProtectionRule::getProtections in User protect 8

Returns the user protections for this protection rule.

Return value

\Drupal\userprotect\Plugin\UserProtection\UserProtectionPluginCollection|\Drupal\userprotect\Plugin\UserProtection\UserProtectionInterface[] The user protection plugin collection.

Overrides ProtectionRuleInterface::getProtections

2 calls to ProtectionRule::getProtections()
ProtectionRule::getPluginCollections in src/Entity/ProtectionRule.php
Gets the plugin collections used by this object.
ProtectionRule::isProtected in src/Entity/ProtectionRule.php
Checks if a given operation on an user should be protected.

File

src/Entity/ProtectionRule.php, line 178

Class

ProtectionRule
Defines the Protection rule entity.

Namespace

Drupal\userprotect\Entity

Code

public function getProtections() {
  if (!isset($this->protectionsCollection)) {
    $this->protectionsCollection = new UserProtectionPluginCollection(UserProtect::pluginManager(), $this->protections);
  }
  return $this->protectionsCollection;
}