LdapTools\Security\Ace\AceType::setValue PHP Method

setValue() public method

Set the type of the Ace.
public setValue ( string | integer $type )
$type string | integer
    public function setValue($type)
    {
        if (is_numeric($type) && in_array($type, self::TYPE)) {
            $this->type = (int) $type;
        } elseif (is_string($type) && array_key_exists(strtoupper($type), self::TYPE)) {
            $this->type = self::TYPE[strtoupper($type)];
        } elseif (is_string($type) && array_key_exists(strtoupper($type), self::SHORT_NAME)) {
            $this->type = self::SHORT_NAME[strtoupper($type)];
        } else {
            throw new InvalidArgumentException(sprintf('The value "%s" is not a valid AceType.', $type));
        }
        return $this;
    }