当前位置: 首页>>代码示例>>PHP>>正文


PHP Expression::notEq方法代码示例

本文整理汇总了PHP中Expression::notEq方法的典型用法代码示例。如果您正苦于以下问题:PHP Expression::notEq方法的具体用法?PHP Expression::notEq怎么用?PHP Expression::notEq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Expression的用法示例。


在下文中一共展示了Expression::notEq方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testHaving

 public function testHaving()
 {
     $query = OQL::select('from TestUser');
     $criteria = Criteria::create(TestUser::dao());
     $this->assertCriteria($query->addHaving(OQL::having('id > 0')), $criteria->addProjection(Projection::having(Expression::gt('id', 0))));
     $this->assertCriteria($query->addHaving(OQL::having('name is not null and (id <> $1 or id != $2)')->bindNext(4)->bindNext(8)), $criteria->addProjection(Projection::having(Expression::expAnd(Expression::notNull('name'), Expression::expOr(Expression::notEq('id', 4), Expression::notEq('id', 8))))));
     $this->assertEquals(OQL::having('id + $15')->bind(15, 16)->toProjection(), Projection::having(Expression::add('id', 16)));
     $this->assertCriteria(OQL::select('from TestUser')->addHaving(OQL::having('id = $1')->bindNext(23))->bindNext(42), Criteria::create(TestUser::dao())->addProjection(Projection::having(Expression::eq('id', 42))));
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:9,代码来源:OqlSelectClauseTest.class.php

示例2: testQuery

 public function testQuery()
 {
     $query = OSQL::delete()->from('pity_table');
     $dialect = ImaginaryDialect::me();
     try {
         $query->toDialectString($dialect);
         $this->fail();
     } catch (WrongArgumentException $e) {
         /* pass */
     }
     $query->where(Expression::eq(1, 2));
     $this->assertEquals($query->toDialectString($dialect), 'DELETE FROM pity_table WHERE (1 = 2)');
     $query->andWhere(Expression::notEq('a', 'b'));
     $this->assertEquals($query->toDialectString($dialect), 'DELETE FROM pity_table WHERE (1 = 2) AND (a != b)');
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:15,代码来源:DeleteQueryTest.class.php

示例3: testQuery

 public function testQuery()
 {
     $query = OSQL::delete()->from('pity_table');
     $dialect = PostgresDialect::me();
     try {
         $query->toDialectString($dialect);
         $this->fail();
     } catch (WrongArgumentException $e) {
         /* pass */
     }
     $query->where(Expression::eq('count', 2));
     $this->assertEquals($query->toDialectString($dialect), 'DELETE FROM "pity_table" WHERE ("count" = \'2\')');
     $query->andWhere(Expression::notEq('a', '2'));
     $this->assertEquals($query->toDialectString($dialect), 'DELETE FROM "pity_table" WHERE ("count" = \'2\') AND ("a" != \'2\')');
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:15,代码来源:OsqlDeleteTest.class.php

示例4: testPgGeneration

 public function testPgGeneration()
 {
     $dialect = $this->getDbByType('PgSQL')->getDialect();
     $this->assertRegExp('/^\\(\\(\\(\\(\'asdf\' = "b"\\) (AND|and) \\("e" != \\("i" \\/ \'123\'\\)\\) (AND|and) \\(\\(lower\\("a"\\) += +lower\\("b"\\)\\) ((IS TRUE)|(is true))\\) (AND|and) \\("g" = \'12\'\\) (AND|and) \\("j" (BETWEEN|between) \'3\' (AND|and) "p"\\)\\) (OR|or) \\("table"\\."c" ((IS NOT NULL)|(is not null))\\)\\) (AND|and) \\("sometable"\\."a" ((not in)|(NOT IN)) \\(\'q\', \'qwer\', \'xcvzxc\', \'wer\'\\)\\)\\)$/', Expression::expAnd(Expression::expOr(Expression::andBlock(Expression::eq(new DBValue('asdf'), new DBField('b')), Expression::notEq(new DBField('e'), Expression::div(new DBField('i'), new DBValue(123))), Expression::isTrue(Expression::eqLower(new DBField('a'), new DBField('b'))), Expression::eq(new DBField('g'), new DBValue(12)), Expression::between('j', new DBValue(3), new DBField('p'))), Expression::notNull(new DBField('c', 'table'))), Expression::notIn(new DBField('a', 'sometable'), array('q', 'qwer', 'xcvzxc', 'wer')))->toDialectString($dialect));
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:5,代码来源:LogicTest.class.php

示例5: testHaving

 public function testHaving()
 {
     $this->assertCriteria('from TestUser having (2 + -id --1) / 2 = id', Criteria::create(TestUser::dao())->setProjection(Projection::having(Expression::eq(Expression::div(Expression::sub(Expression::add(2, Expression::minus('id')), -1), 2), 'id'))), array(1 => 'id'))->assertCriteria('from TestUser having (id = 1) != ((1 = id) = (id >= 2))', Criteria::create(TestUser::dao())->setProjection(Projection::having(Expression::notEq(Expression::eq('id', 1), Expression::eq(Expression::eq(1, 'id'), Expression::gtEq('id', 2))))))->assertCriteria('from TestUser having $1 = 1', Criteria::create(TestUser::dao())->setProjection(Projection::having(Expression::eq(SQLFunction::create('count', 'id'), 1))), array(1 => SQLFunction::create('count', 'id')));
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:4,代码来源:OqlSelectTest.class.php


注:本文中的Expression::notEq方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。