コード例 #1
0
ファイル: Builder.php プロジェクト: samhsuqld/Adldap2
 /**
  * Adds an or where clause to the current query.
  *
  * @param string      $field
  * @param string|null $operator
  * @param string|null $value
  *
  * @return Builder
  */
 public function orWhere($field, $operator = null, $value = null)
 {
     $this->orWheres[] = [self::$whereFieldKey => $field, self::$whereOperatorKey => $this->getOperator($operator), self::$whereValueKey => Utilities::escape($value)];
     return $this;
 }
コード例 #2
0
ファイル: Builder.php プロジェクト: jal617b/Adldap2
 /**
  * Adds the inserted field, operator and value
  * to the orWheres property array.
  *
  * @param string $field
  * @param string $operator
  * @param null   $value
  *
  * @throws InvalidQueryOperatorException
  */
 private function addOrWhere($field, $operator, $value = null)
 {
     $this->orWheres[] = [self::$whereFieldKey => $field, self::$whereOperatorKey => $this->getOperator($operator), self::$whereValueKey => Utilities::escape($value)];
 }
コード例 #3
0
ファイル: Builder.php プロジェクト: kichetof/Adldap2
 /**
  * Adds a binding to the query.
  *
  * @param string $field
  * @param string $operator
  * @param string $value
  * @param string $type
  *
  * @throws InvalidQueryOperatorException
  *
  * @return Builder
  */
 public function addBinding($field, $operator, $value, $type = 'where')
 {
     if (!array_key_exists($type, $this->bindings)) {
         throw new InvalidArgumentException("Invalid binding type: {$type}.");
     }
     $operator = $this->getOperator($operator);
     $value = Utilities::escape($value);
     $this->{$this->bindings[$type]}[] = compact('field', 'operator', 'value');
     return $this;
 }
コード例 #4
0
ファイル: DistinguishedName.php プロジェクト: rieschl/Adldap2
 /**
  * Assembles an RDN with the specified attribute and value.
  *
  * @param string $attribute
  * @param array  $values
  *
  * @return null|string
  */
 private function assembleRdns($attribute, array $values = [])
 {
     if (count($values) > 0) {
         $values = array_reverse($values);
         $values = array_map(function ($value) use($attribute) {
             return $attribute . '=' . Utilities::escape($value, '', 2);
         }, $values);
         return implode(',', $values);
     }
     return null;
 }
コード例 #5
0
 /**
  * Assembles an RDN with the specified attribute and value.
  *
  * @param string $attribute
  * @param array  $values
  *
  * @return null|string
  */
 protected function assembleRdns($attribute, array $values = [])
 {
     if (count($values) > 0) {
         $values = array_reverse($values);
         $values = array_map(function ($value) use($attribute) {
             return sprintf('%s=%s', $attribute, Utilities::escape($value, '', 2));
         }, $values);
         return implode(',', $values);
     }
     return;
 }