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


PHP Dao::findByCriteria方法代码示例

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


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

示例1: findByCriteria

 /**
  * Get a set of results that match a particular where clause
  *
  * @param string $criteria      The search criteria string
  * @param array  $params        The parameters of the query to replace '?'(without the quotes)
  * @param array  $orderByParams The order clause Array[Entity.Field] = 'direction'
  *
  * @return array
  */
 public function findByCriteria($criteria, array $params = array(), $searchActiveOnly = true, $pageNumber = null, $pageSize = DaoQuery::DEFAUTL_PAGE_SIZE, array $orderByParams = array())
 {
     $results = Dao::findByCriteria($this->_query->setSelectActiveOnly($searchActiveOnly), $criteria, $params, $pageNumber, $pageSize, $orderByParams);
     $this->_pageStats = Dao::getPageStats();
     $this->resetQuery();
     return $results;
 }
开发者ID:larryu,项目名称:magento-b2b,代码行数:16,代码来源:EntityDao.php

示例2: loadManyToMany

 /**
  * Lazy load a many-to-many relationship
  *
  * @param string $property The property that we are trying to load
  *
  * @return BaseEntityAbstract
  */
 protected function loadManyToMany($property)
 {
     // Grab the DaoMap data for both ends of the join
     $this->__loadDaoMap();
     $cls = DaoMap::$map[strtolower(get_class($this))][$property]['class'];
     $obj = new $cls();
     $obj->__loadDaoMap();
     $thisClass = get_class($this);
     $qry = new DaoQuery($cls);
     $qry->eagerLoad($cls . '.' . strtolower(substr($thisClass, 0, 1)) . substr($thisClass, 1) . 's');
     // Load this end with an array of entities typed to the other end
     DaoMap::loadMap($cls);
     $alias = DaoMap::$map[strtolower($cls)]['_']['alias'];
     $field = strtolower(substr($thisClass, 0, 1)) . substr($thisClass, 1);
     $this->{$property} = Dao::findByCriteria($qry, sprintf('`%sId`=?', $field), array($this->getId()));
     return $this;
 }
开发者ID:larryu,项目名称:magento-b2b,代码行数:24,代码来源:BaseEntityAbstract.php


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