You are here

class PagesRestrictionHelper in Pages Restriction Access 8

Helper for Pages Restriction.

Hierarchy

Expanded class hierarchy of PagesRestrictionHelper

1 file declares its use of PagesRestrictionHelper
PagesRestrictionSubscriber.php in src/Event/PagesRestrictionSubscriber.php
1 string reference to 'PagesRestrictionHelper'
pages_restriction.services.yml in ./pages_restriction.services.yml
pages_restriction.services.yml
1 service uses PagesRestrictionHelper
pages_restriction.helper in ./pages_restriction.services.yml
Drupal\pages_restriction\Service\PagesRestrictionHelper

File

src/Service/PagesRestrictionHelper.php, line 10

Namespace

Drupal\pages_restriction\Service
View source
class PagesRestrictionHelper {

  /**
   * Get Restricted Pages by Config.
   */
  public function getRestrictedPagesByConfig($configRestrictedPages) {
    if (empty($configRestrictedPages)) {
      return FALSE;
    }
    $restrictedPages = [];
    foreach ($configRestrictedPages as $restrictedPage) {
      $restrictedPage = explode('|', $restrictedPage);
      if (empty($restrictedPage)) {
        continue;
      }
      $restrictedPath = Xss::filter($restrictedPage[0]);
      $restrictedPath = trim($restrictedPath);
      $restrictedPages[] = $restrictedPath;
    }
    return $restrictedPages;
  }

}

Members