Ejemplo n.º 1
0
 public function getID()
 {
     if ($this->id_col === null) {
         $this->id_col = $this->_statement->getCriteria()->getTable()->getIdColumn();
     }
     return $this->get($this->id_col);
 }
Ejemplo n.º 2
0
 public function __construct(Statement $statement)
 {
     try {
         $this->crit = $statement->getCriteria();
         if ($this->crit instanceof Criteria) {
             if ($this->crit->action == 'insert') {
                 $this->insert_id = $statement->getInsertID();
             } elseif ($this->crit->action == 'select') {
                 while ($row = $statement->fetch()) {
                     $this->rows[] = new Row($row, $statement);
                 }
                 $this->max_ptr = count($this->rows);
                 $this->int_ptr = 0;
             } elseif ($this->crit->action = 'count') {
                 $value = $statement->fetch();
                 $this->max_ptr = $value['num_col'];
             }
         }
     } catch (\Exception $e) {
         throw $e;
     }
 }