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


PHP Doctrine_Query::getConnection方法代码示例

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


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

示例1: __construct

 /**
  * constructor
  *
  * @param Doctrine_Query $query
  */
 public function __construct(Doctrine_Query $query, $viewName)
 {
     $this->name = $viewName;
     $this->query = $query;
     $this->query->setView($this);
     $this->conn = $query->getConnection();
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:12,代码来源:View.php

示例2: __construct

 /**
  * constructor
  *
  * @param Doctrine_Query $query
  */
 public function __construct(Doctrine_Query $query, $viewName)
 {
     $this->_name = $viewName;
     $this->_query = $query;
     $this->_query->setView($this);
     $this->_conn = $query->getConnection();
     $this->_dql = $query->getDql();
     $this->_sql = $query->getSqlQuery();
 }
开发者ID:seven07ve,项目名称:vendorepuestos,代码行数:14,代码来源:View.php

示例3: update

 private function update($table_name, $d, $id)
 {
     $tid = $id;
     if (!is_array($id)) {
         $tid = array('id' => $id);
     }
     $table = Doctrine::getTable($table_name);
     $dq = new Doctrine_Query();
     $conn = $dq->getConnection();
     return $conn->update($table, $d, $tid);
 }
开发者ID:xmasclaux,项目名称:OpenGenepi,代码行数:11,代码来源:actions.class.php

示例4: getSourceName

 /**
  * Should return the database server name or source name
  *
  * Ex: mysql, pgsql, array, xml
  *
  * @return string
  */
 public function getSourceName()
 {
     return strtolower($this->_query->getConnection()->getDriverName());
 }
开发者ID:robjacoby,项目名称:xlr8u,代码行数:11,代码来源:Doctrine.php

示例5: modifyImpl

 protected function modifyImpl(Doctrine_Query &$o)
 {
     if (!$this->ignoreIds) {
         $table = $o->getConnection()->getTable($this->getTarget());
         $keys = $table->getIdentifierColumnNames();
         $o->addSelect(implode($keys));
     } else {
         $o->disableAutoIdentifierFields(true);
     }
     foreach ($this->additionalSelects as $alias => $select) {
         $o->addSelect($select . (is_numeric($alias) ? "" : " AS " . $alias));
     }
     $db = $this->getContext()->getDatabaseManager()->getDatabase('icinga');
     // check if retained state must be respected
     if (method_exists($db, "useRetained")) {
         /*
          * the core with idomod dumps 2 different config types
          * idomod.cfg:config_output_options
          * 1 = original config => config_type = 0
          * 2 = retained config => config_type = 1
          * 3 = both, both config_types are available
          */
         if ($this->retainedAlias) {
             $o->andWhere($this->retainedAlias . ".config_type= ?", $db->useRetained() ? "1" : "0");
         }
     }
     if ($this->getTarget() == "IcingaObjects") {
         $o->andWhere($this->mainAlias . ".is_active = 1");
     }
     foreach ($this->forceGroup as $group) {
         $o->addGroupBy($group);
     }
     parent::modifyImpl($o);
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:34,代码来源:TargetModifierModel.class.php

示例6: executeUpdateFilter

    public function executeUpdateFilter(sfWebRequest $request)
    {
        $this->menu = $this->getMenu('index');
        $this->informations = $this->getInformations();
        $id = $request->getParameter('id');
        $sql = <<<ENDSQL
\t\t\tSELECT domain, lists_id, ordre
\t\t\tFROM lists_filter
\t\t\tJOIN lists ON lists_filter.list_id = lists.id
\t\t\tJOIN lists_detail ON lists.id = lists_detail.lists_id
\t\t\tWHERE lists_filter.filter_id = '{$id}'
\t\t\tAND lists.origin = 'SI'
\t\t\tORDER BY ordre
ENDSQL;
        $dq = new Doctrine_Query();
        $conn = $dq->getConnection();
        $filters_private_lists_res = $conn->fetchAll($sql);
        foreach ($filters_private_lists_res as $filter) {
            if ($filter['domain'] != '') {
                switch ($filter['ordre']) {
                    case 0:
                        $globale_whitelist .= $filter['domain'] . "\n";
                        break;
                    case 1:
                        $globale_blacklist .= $filter['domain'] . "\n";
                        break;
                    case 2:
                        $private_whitelist .= $filter['domain'] . "\n";
                        break;
                    case 3:
                        $private_blacklist .= $filter['domain'] . "\n";
                        break;
                    case 4:
                        $other_blacklists[$filter['lists_id']] = $filter['lists_id'];
                        break;
                }
            }
        }
        $this->globale_whitelist = $globale_whitelist;
        $this->globale_blacklist = $globale_blacklist;
        $this->private_whitelist = $private_whitelist;
        $this->private_blacklist = $private_blacklist;
        // @TODO  ////////////////////////////////////////////////////////////
        $sql = <<<SQL
\t\t\tSELECT li.id, li.name, lf.ordre
\t\t\tFROM lists li
\t\t\t\tLEFT JOIN lists_filter lf ON li.id = lf.list_id
\t\t\tWHERE lf.filter_id = '{$id}'
\t\t\t\tAND li.origin != 'SI'
SQL;
        $dq = new Doctrine_Query();
        $conn = $dq->getConnection();
        $filters_to = $conn->fetchAll($sql);
        foreach ($filters_to as $filterT) {
            $aaa = $filterT['id'];
            $other_blacklists[$aaa] = $aaa;
        }
        $this->other_blacklists = $other_blacklists;
        $this->aaa = $filters_to;
        $lists = Doctrine_Query::create()->select('l.name, l.id')->from('Lists l')->where('origin != ?', 'SI')->orderBy('name')->execute();
        $this->lists = $lists;
        $filters = Doctrine_Query::create()->select('name, description, id')->from('Filter')->where('id = ?', $request->getParameter('id'))->execute();
        $this->filters = $filters;
        return;
    }
开发者ID:xmasclaux,项目名称:OpenGenepi,代码行数:65,代码来源:actions.class.php


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