isNull() public static method

public static isNull ( )
コード例 #1
0
 /**
  * @test
  */
 public function shouldCreateSql()
 {
     //given
     $restriction = Restrictions::isNull();
     //when
     $sql = $restriction->toSql('category_id');
     //then
     $this->assertEquals('category_id IS NULL', $sql);
 }
コード例 #2
0
ファイル: RestrictionsTest.php プロジェクト: letsdrink/ouzo
 /**
  * @test
  */
 public function shouldReturnModelUsingIsNullRestriction()
 {
     //given
     Product::create(array('name' => 'tech', 'description' => 'some desc'));
     $product = Product::create(array('name' => 'tech'));
     //when
     $loadedProduct = Product::where(array('description' => Restrictions::isNull()))->fetch();
     //then
     Assert::thatModel($loadedProduct)->isEqualTo($product);
 }
コード例 #3
0
ファイル: ArrayWhereClause.php プロジェクト: letsdrink/ouzo
 public function __construct($where, $operator = 'AND')
 {
     foreach ($where as $column => $value) {
         if ($value === null) {
             $where[$column] = Restrictions::isNull();
         }
     }
     $this->where = $where;
     $this->values = Arrays::flatten(array_values($where));
     $this->operator = $operator;
 }