/** * Constructor method * * @param string $id The identifier for current permission * @param integer $binary_representation The numeric representation of current permission. If not specified, an unike representation will be assigned. */ public final function __construct($id, $binary_representation = null) { $this->_id = strtoupper($id); if ($binary_representation === null) { $this->_binary_representation = __Permission::$_next_binary_representation; __Permission::$_next_binary_representation = __Permission::$_next_binary_representation * 2; } else { if (is_numeric($binary_representation)) { $this->_binary_representation = $binary_representation; } else { throw __ExceptionFactory::getInstance()->createException('ERR_WRONG_BINARY_REPRESENTATION_FOR_PERMISSION'); } } }