Horde_Rdo_Query::combineWith PHP Method

combineWith() public method

public combineWith ( string $conjunction )
$conjunction string SQL conjunction such as "AND", "OR".
    public function combineWith($conjunction)
    {
        $this->conjunction = $conjunction;
        return $this;
    }

Usage Example

示例#1
0
 /**
  * Turn any of the acceptable query shorthands into a full
  * Horde_Rdo_Query object. If you pass an existing Horde_Rdo_Query
  * object in, it will be cloned before it's returned so that it
  * can be safely modified.
  *
  * @param mixed $query The query to convert to an object.
  * @param Horde_Rdo_Mapper $mapper The Mapper object governing this query.
  *
  * @return Horde_Rdo_Query The full Horde_Rdo_Query object.
  */
 public static function create($query, $mapper = null)
 {
     if ($query instanceof Horde_Rdo_Query || $query instanceof Horde_Rdo_Query_Literal) {
         $query = clone $query;
         if (!is_null($mapper)) {
             $query->setMapper($mapper);
         }
         return $query;
     }
     $q = new Horde_Rdo_Query($mapper);
     if (is_scalar($query)) {
         $q->addTest($mapper->tableDefinition->getPrimaryKey(), '=', $query);
     } elseif ($query) {
         $q->combineWith('AND');
         foreach ($query as $key => $value) {
             $q->addTest($key, '=', $value);
         }
     }
     return $q;
 }
All Usage Examples Of Horde_Rdo_Query::combineWith