當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Doctrine_Connection::getTable方法代碼示例

本文整理匯總了PHP中Doctrine_Connection::getTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Connection::getTable方法的具體用法?PHP Doctrine_Connection::getTable怎麽用?PHP Doctrine_Connection::getTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine_Connection的用法示例。


在下文中一共展示了Doctrine_Connection::getTable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * execute
  * executes the query and populates the data set
  *
  * @param string $params
  * @return Doctrine_Collection            the root collection
  */
 public function execute($params = array(), $hydrationMode = null)
 {
     if ($this->_cache) {
         $cacheDriver = $this->getCacheDriver();
         $dql = $this->getDql();
         // calculate hash for dql query
         $hash = md5($dql . var_export($params, true));
         $cached = $this->_expireCache ? null : $cacheDriver->fetch($hash);
         if ($cached === null) {
             // cache miss
             $stmt = $this->_execute($params);
             $array = $this->parseData2($stmt, self::HYDRATE_ARRAY);
             $cached = $this->getCachedForm($array);
             $cacheDriver->save($hash, $cached, $this->_timeToLive);
         } else {
             $cached = unserialize($cached);
             $this->_tableAliases = $cached[2];
             $array = $cached[0];
             $map = array();
             foreach ($cached[1] as $k => $v) {
                 $e = explode('.', $v[0]);
                 if (count($e) === 1) {
                     $map[$k]['table'] = $this->_conn->getTable($e[0]);
                 } else {
                     $map[$k]['parent'] = $e[0];
                     $map[$k]['relation'] = $map[$e[0]]['table']->getRelation($e[1]);
                     $map[$k]['table'] = $map[$k]['relation']->getTable();
                 }
                 if (isset($v[1])) {
                     $map[$k]['agg'] = $v[1];
                 }
             }
             $this->_aliasMap = $map;
         }
     } else {
         $stmt = $this->_execute($params);
         if (is_integer($stmt)) {
             return $stmt;
         }
         $array = $this->parseData2($stmt, $hydrationMode);
     }
     return $array;
 }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:50,代碼來源:Hydrate.php

示例2: getClassnameToReturn

 /**
  * Get the classname to return. Most often this is just the options['name']
  *
  * Check the subclasses option and the inheritanceMap for each subclass to see
  * if all the maps in a subclass is met. If this is the case return that
  * subclass name. If no subclasses match or if there are no subclasses defined
  * return the name of the class for this tables record.
  *
  * @todo this function could use reflection to check the first time it runs
  * if the subclassing option is not set.
  *
  * @return string The name of the class to create
  * @deprecated
  */
 public function getClassnameToReturn()
 {
     if (!isset($this->_options['subclasses'])) {
         return $this->_options['name'];
     }
     foreach ($this->_options['subclasses'] as $subclass) {
         $table = $this->_conn->getTable($subclass);
         $inheritanceMap = $table->getOption('inheritanceMap');
         $nomatch = false;
         foreach ($inheritanceMap as $key => $value) {
             if (!isset($this->_data[$key]) || $this->_data[$key] != $value) {
                 $nomatch = true;
                 break;
             }
         }
         if (!$nomatch) {
             return $table->getComponentName();
         }
     }
     return $this->_options['name'];
 }
開發者ID:mediasadc,項目名稱:alba,代碼行數:35,代碼來源:Table.php


注:本文中的Doctrine_Connection::getTable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。