當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。