Ouzo\Db\Any::of PHP Метод

of() публичный статический Метод

public static of ( array $conditions )
$conditions array
    public static function of(array $conditions)
    {
        if (Arrays::isAssociative($conditions)) {
            return new ArrayWhereClause($conditions, 'OR');
        }
        return new OrClause($conditions);
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function shouldUseBothAndOrOperator()
 {
     // given
     $query = new Query();
     $query->table = 'products';
     $query->where(array('a' => '5'));
     $query->where(Any::of(array('name' => 'bob', 'id' => '1')));
     // when
     $sql = $this->dialect->buildQuery($query);
     // then
     $this->assertEquals('SELECT * FROM products WHERE a = ? AND (name = ? OR id = ?)', $sql);
 }
All Usage Examples Of Ouzo\Db\Any::of
Any