Get permission by its name

@param string $name
@return null|IPermission
193974
public function getByName(string $name): ?IPermission
    {
        if ($this->permissions === null) {
            $this->getAll();
        }

        if (!isset($this->names[$name])) {
            return null;
        }

        return $this->permissions[$this->names[$name]];
    }
865031
public function getDirective($name)
    {
        foreach ($this->getDirectives() as $directive) {
            if ($directive->getName() === $name) {
                return $directive;
            }
        }
        return NULL;
    }
1287162
public function getPermission($role)
    {
        if ($role instanceof RoleInterface || $role instanceof \Symfony\Component\Security\Core\Role\Role) {
            $role = $role->getRole();
        }
        if (isset($this->permissions[$role])) {
            return $this->permissions[$role];
        }

        return null;
    }
262704
public static function get(string $name)
  {
    if (isset($_SESSION['application']['with'][$name])) {
      $_SESSION['application']['flash']['used'] = true;
      return $_SESSION['application']['with'][$name];
    }

    return Variable::has($name) ? Variable::$data[$name] : null;
  }
1159434
public function get($name)
    {
        $name = $this->cleanAttributeName($name);

        return isset($this->props[$name]) ? $this->props[$name] : null;
    }
1220085
public function permissionGetIdByName($name)
  {
    if(!array_key_exists((string) $name, $this->permissionList()))
    {
      throw new Exception("invalid permission ID", 0xA02);
    }

    return $this->permissionList[(string) $name]["permid"];
  }
1061944
public function can($name)
    {
        foreach ($this->permissions as $permission) {
            if ($permission->name == $name || $permission->id == $name) {
                return true;
            }
        }

        return false;
    }
1243485
public function getGetter($name)
    {
        if ($this->getters === null) {
            $this->createGetters();
        }
        return isset($this->getters[$name]) ? $this->getters[$name] : null;
    }
696857
public function getPermissionIdByName($permissionName)
    {
        $qb = $this->createQueryBuilder('permission');

        $result = $qb->select('permission.id')
            ->where($qb->expr()->eq('permission.name', $qb->expr()->literal($permissionName)))
            ->setMaxResults(1)
            ->getQuery()
            ->getArrayResult();

        if (count($result) > 0) {
            return $result[0]['id'];
        }

        return null;
    }
922427
public function getIdPrivilegeByName(string $name): string
    {
        if (isset($this->privilege[$name])) {
            return (string) $this->privilege[$name]['id'];
        }
        return '';
    }
1282815
public function getProperty($name = null)
    {
        if (is_null($name)) {
            return null;
        }
        return $this->properties->get($name);
    }
523588
public function getGet($name = null)
    {
        if ($name !== null) {
            return isset($this->getParams[$name]) ? $this->getParams[$name] : null;
        }

        return $this->getParams;
    }
225412
public function getPolicy($name)
    {
        if (isset($this->policies[$name])) {
            return $this->policies[$name];
        }

        return null;
    }
557573
public function get($name) {
        return isset($this->metadata[$name]) ? $this->metadata[$name] : null;
    }
604432
public function get($name)
    {
        return isset($this->rules[$name]) ? $this->rules[$name] : null;
    }
817691
public function get_header($name = null)
	{
		if (func_num_args())
		{
			return isset($this->headers[$name]) ? $this->headers[$name] : null;
		}
		else
		{
			return $this->headers;
		}
	}
950682
public function getByName($name)
    {
        return isset($this->names[$name]) ? $this->names[$name] : null;
    }