public function __construct(B2DBStatement $statement) { try { $this->crit = $statement->getCriteria(); if ($this->crit instanceof B2DBCriteria) { if ($this->crit->action == 'insert') { $this->insert_id = $statement->getInsertID(); } elseif ($this->crit->action == 'select') { while ($row = $statement->fetch()) { $this->rows[] = new B2DBRow($row, $statement); } $this->max_ptr = count($this->rows); $this->int_ptr = 0; } elseif ($this->crit->action = 'count') { $value = $statement->fetch(); $this->num_col = $value['num_col']; } } } catch (Exception $e) { throw $e; } }
/** * Return the associated B2DBCriteria * * @return B2DBCriteria */ public function getCriteria() { return $this->_statement->getCriteria(); }