Horde_Perms_Permission::__construct PHP Method

__construct() public method

Constructor.
public __construct ( string $name, integer $cacheVersion = null, string $type = 'matrix', array $params = null )
$name string The name of the perm.
$cacheVersion integer The revision number of the class.
$type string The permission type.
$params array A hash with any parameters that the permission type needs.
    public function __construct($name, $cacheVersion = null, $type = 'matrix', $params = null)
    {
        $this->setName($name);
        $this->setCacheVersion($cacheVersion);
        $this->data['type'] = $type;
        if (is_array($params)) {
            $this->data['params'] = $params;
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Constructor.
  *
  * @param Horde_Perms_Permission_Kolab_Storage $storage The storage object
  *                                                      represented by this
  *                                                      permission instance.
  *
  * @param Horde_Group_Base $groups                      The group handler.
  */
 public function __construct(Horde_Perms_Permission_Kolab_Storage $storage, Horde_Group_Base $groups)
 {
     parent::__construct(__CLASS__ . '::' . $storage->getPermissionId());
     $this->_storage = $storage;
     $this->_groups = $groups;
     $this->data = $this->getCurrentPermissions();
 }