Adldap\Query\Operator::all PHP Method

all() public static method

Returns all available operators.
public static all ( ) : array
return array
    public static function all()
    {
        return (new ReflectionClass(new static()))->getStaticProperties();
    }

Usage Example

示例#1
0
 /**
  * Retrieves an operator from the available operators.
  *
  * Throws an AdldapException if no operator is found.
  *
  * @param string $operator
  *
  * @throws InvalidQueryOperatorException
  *
  * @return string
  */
 private function validateOperator($operator)
 {
     $operators = Operator::all();
     $key = array_search(strtolower($operator), $operators);
     if ($key !== false && array_key_exists($key, $operators)) {
         return $operators[$key];
     }
     $operators = implode(', ', $operators);
     $message = "Operator: {$operator} cannot be used in an LDAP query. Available operators are: {$operators}";
     throw new InvalidQueryOperatorException($message);
 }
All Usage Examples Of Adldap\Query\Operator::all
Operator