Пример #1
0
 /**
  * Set up this query and join the initial tables
  *
  * @see IdoQuery::initializeForPostgres     For postgresql specific setup
  */
 protected function init()
 {
     parent::init();
     $this->prefix = $this->ds->getTablePrefix();
     foreach (Hook::all('monitoring/idoQueryExtension') as $hook) {
         $extensions = $hook->extendColumnMap($this);
         if (!is_array($extensions)) {
             continue;
         }
         foreach ($extensions as $vTable => $cols) {
             if (!array_key_exists($vTable, $this->columnMap)) {
                 $this->hookedVirtualTables[$vTable] = $hook;
                 $this->columMap[$vTable] = array();
             }
             foreach ($cols as $k => $v) {
                 $this->columnMap[$vTable][$k] = $v;
             }
         }
     }
     $dbType = $this->ds->getDbType();
     if ($dbType === 'oracle') {
         $this->initializeForOracle();
     } elseif ($dbType === 'pgsql') {
         $this->initializeForPostgres();
     }
     $this->joinBaseTables();
     $this->select->columns($this->columns);
     $this->prepareAliasIndexes();
 }
Пример #2
0
 protected function getHookedColumns()
 {
     $columns = array();
     foreach (Hook::all('monitoring/dataviewExtension') as $hook) {
         foreach ($hook->getAdditionalQueryColumns($this->getQueryName()) as $col) {
             $columns[] = $col;
         }
     }
     return $columns;
 }