public function getPerTimeHeader($is_admin = false)
 {
     $metadata = new Metadata($this->adapter);
     $header = $metadata->getColumnNames($this->table);
     //        return ($is_admin) ? $header : array_diff($header, $this->adminFields);
     return $is_admin ? $header : $header;
 }
Exemple #2
0
 protected function _insertInto($table, array $data, $columns = null)
 {
     if (!$data) {
         return;
     }
     if ($columns === null) {
         $columns = $this->_metadata->getColumnNames($table);
     }
     $insertStmt = new InsertMultiple($table);
     if ($columns !== null) {
         $insertStmt->columns($columns);
     }
     foreach ($data as $row) {
         $insertStmt->values($row, InsertMultiple::VALUES_MERGE);
     }
     $sql = $this->_sql->buildSqlString($insertStmt);
     $this->_db->query($sql, Adapter::QUERY_MODE_EXECUTE);
 }
 /**
  * @param $filter
  * @param $orderBy
  * @param $order
  * @param string $source
  * @return Paginator
  * @throws \Exception
  */
 public function paginate($filter, $orderBy, $order, $source = '')
 {
     try {
         $metadata = new Metadata($this->adapter);
         if (empty($source)) {
             $source = $this->table;
         }
         $columns = $metadata->getColumnNames($source);
         $select = new Select($source);
         $select->order($orderBy . ' ' . $order);
         if (!empty($filter)) {
             $query = "CONCAT_WS(' '," . implode(',', $columns) . ') LIKE ?';
             $where = new Where();
             $where->literal($query, '%' . $filter . '%');
             $select->where($where);
         }
         $paginatorAdapter = new DbSelect($select, $this->adapter);
         return new Paginator($paginatorAdapter);
     } catch (\Exception $ex) {
         throw $ex;
     }
 }
 public function getPerTimeHeaderPrivateExchange()
 {
     $metadata = new Metadata($this->adapter);
     $header = $metadata->getColumnNames('PublisherImpressionsAndSpendHourly');
     return array_values(array_diff($header, $this->domainAdminFields));
 }
 public function getPerTimeHeader($is_admin = false)
 {
     $metadata = new Metadata($this->adapter);
     $header = $metadata->getColumnNames('buySideHourlyBidsPerTime');
     return $is_admin ? $header : array_values(array_diff($header, $this->adminFields));
 }
 public function getPerTimeHeader($is_admin = false)
 {
     $metadata = new Metadata($this->adapter);
     $header = $metadata->getColumnNames('PublisherImpressionsAndSpendHourly');
     return $is_admin ? $header : array_values(array_diff($header, $this->adminFields));
 }
 public function getUserImpressionsSpendHeadersAdmin()
 {
     $metadata = new Metadata($this->adapter);
     return $metadata->getColumnNames('userImpressionsSpendAdmin');
 }
 /**
  * Get tables' columns
  * 
  * @param type $table
  * @return array
  */
 public function getCols($table)
 {
     $metadata = new Metadata($this->getAdapter());
     return $metadata->getColumnNames($table);
 }
 public function getAverageHeaderAdmin()
 {
     $metadata = new Metadata($this->adapter);
     return $metadata->getColumnNames('buySideHourlyBidsAvarageAdmin');
 }