コード例 #1
0
ファイル: AbstractHelper.php プロジェクト: rikaix/zf2
 /**
  * Sets default ACL role(s) to use when iterating pages if not explicitly
  * set later with {@link setRole()}
  *
  * @param  mixed $role [optional] role to set. Expects null, string, or an 
  *                     instance of {@link Acl\Role\RoleInterface}. Default is null, which
  *                     sets no default role.
  * @return void
  * @throws Exception\InvalidArgumentException if role is invalid
  */
 public static function setDefaultRole($role = null)
 {
     if (null === $role || is_string($role) || $role instanceof Acl\Role\RoleInterface) {
         self::$defaultRole = $role;
     } else {
         throw new Exception\InvalidArgumentException(sprintf('$role must be null|string|Zend\\Acl\\Role\\RoleInterface; received "%s"', is_object($role) ? get_class($role) : gettype($role)));
     }
 }
コード例 #2
0
ファイル: AbstractHelper.php プロジェクト: bradley-holt/zf2
 /**
  * Sets default ACL role(s) to use when iterating pages if not explicitly
  * set later with {@link setRole()}
  *
  * @param  mixed $role [optional] role to set. Expects null, string, or an 
  *                     instance of {@link Acl\Role}. Default is null, which 
  *                     sets no default role.
  * @return void
  * @throws Exception\InvalidArgumentException if role is invalid
  */
 public static function setDefaultRole($role = null)
 {
     if (null === $role || is_string($role) || $role instanceof Acl\Role) {
         self::$defaultRole = $role;
     } else {
         throw new Exception\InvalidArgumentException('$role must be null|string|Zend\\Acl\\Role');
     }
 }