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


PHP Criteria::addAnd方法代码示例

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


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

示例1: testAddAndDistinctColumns

 public function testAddAndDistinctColumns()
 {
     $table1 = "myTable1";
     $column1 = "myColumn1";
     $value1 = "myValue1";
     $key1 = "{$table1}.{$column1}";
     $table2 = "myTable2";
     $column2 = "myColumn2";
     $value2 = "myValue2";
     $key2 = "{$table2}.{$column2}";
     $this->c->add($key1, $value1, Criteria::EQUAL);
     $this->c->addAnd($key2, $value2, Criteria::EQUAL);
     $expect = "SELECT  FROM myTable1, myTable2 WHERE myTable1.myColumn1=:p1 AND myTable2.myColumn2=:p2";
     $params = array();
     $result = $this->c->createSelectSql($params);
     $expect_params = array(array('table' => 'myTable1', 'column' => 'myColumn1', 'value' => 'myValue1'), array('table' => 'myTable2', 'column' => 'myColumn2', 'value' => 'myValue2'));
     $this->assertEquals($expect, $result, 'addAnd() called on a distinct column adds a criterion to the criteria');
     $this->assertEquals($expect_params, $params, 'addAnd() called on a distinct column adds a criterion to the criteria');
 }
开发者ID:robin850,项目名称:Propel2,代码行数:19,代码来源:CriteriaTest.php

示例2: getLocaleCriteria

 /**
  * @param \Generated\Shared\Transfer\LocaleTransfer $localeTransfer
  *
  * @return \Propel\Runtime\ActiveQuery\Criteria
  */
 protected function getLocaleCriteria(LocaleTransfer $localeTransfer)
 {
     $localeCriteria = new Criteria();
     $localeCriteria->addAnd(PavCmsLocalizedBlockTableMap::COL_FK_LOCALE, $localeTransfer->getIdLocale(), Criteria::EQUAL);
     $localeCriteria->_or();
     $localeCriteria->addAnd(PavCmsLocalizedBlockTableMap::COL_ID_CMS_LOCALIZED_BLOCK, null, Criteria::ISNULL);
     return $localeCriteria;
 }
开发者ID:project-a,项目名称:spryker-cms-block,代码行数:13,代码来源:CmsBlockQueryContainer.php

示例3: getLocalisedAttributes

 /**
  * @param int $idLocale
  *
  * @return \Orm\Zed\Category\Persistence\SpyCategoryAttribute[]|\Propel\Runtime\Collection\ObjectCollection
  */
 public function getLocalisedAttributes($idLocale)
 {
     $criteria = new Criteria();
     $criteria->addAnd(SpyCategoryAttributeTableMap::COL_FK_LOCALE, $idLocale, Criteria::EQUAL);
     return $this->getAttributes($criteria);
 }
开发者ID:spryker,项目名称:Category,代码行数:11,代码来源:AbstractSpyCategory.php


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