Example #1
0
 protected function addWhere(Doctrine_Query_Abstract $doctrine, $condtion, $value)
 {
     $whereExist = $doctrine->getParams('where');
     if ($whereExist[1] > 0) {
         return $doctrine->addWhere($condtion, $value);
     } else {
         return $doctrine->where($condtion, $value);
     }
 }
Example #2
0
 /**
  * Constructor.
  *
  * @param Doctrine_Connection  The connection object the query will use.
  * @param Doctrine_Hydrator_Abstract  The hydrator that will be used for generating result sets.
  */
 function __construct(Doctrine_Connection $connection = null, Doctrine_Hydrator_Abstract $hydrator = null)
 {
     parent::__construct($connection, $hydrator);
     // Fix #1472. It's alid to disable QueryCache since there's no DQL for RawSql.
     // RawSql expects to be plain SQL + syntax for SELECT part. It is used as is in query execution.
     $this->useQueryCache(false);
 }
Example #3
0
 protected function clear()
 {
     parent::clear();
     $this->_preQuery = false;
     $this->_pendingJoinConditions = array();
 }
 /**
  * First step. Step into the component path and create all
  * join relations beginning by the startRelation
  * @param string $startRelation
  * @param Doctrine_Query_Abstract $query
  * @return string The new alias for the where conditions
  */
 private function createJoins($startRelation, Doctrine_Query_Abstract $query)
 {
     $path = explode('.', $this->componentPath);
     $startComponent = array_shift($path);
     $query->innerJoin($startRelation . '.' . $startComponent . ' ' . $this->genAlias());
     foreach ($path as $sub) {
         $query->innerJoin($this->lastAlias . '.' . $sub . ' ' . $this->genAlias());
     }
     return $this->lastAlias;
 }