Exemple #1
0
 public function formatOne(StatementInterface $stmt)
 {
     $this->checkInit();
     $result = null;
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $result = $this->getAllObjectsFromRow($row);
     }
     $stmt->closeCursor();
     return $result;
 }
 public function formatOne(StatementInterface $stmt)
 {
     $this->checkInit();
     $result = null;
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         if ($rowArray = $this->getStructuredArrayFromRow($row)) {
             $result = $rowArray;
         }
     }
     $stmt->closeCursor();
     return $result;
 }
Exemple #3
0
 public function formatOne(StatementInterface $stmt)
 {
     $this->checkInit();
     $result = null;
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         if ($object =& $this->getStructuredArrayFromRow($row)) {
             $result =& $object;
         }
     }
     $this->currentObjects = array();
     $this->alreadyHydratedObjects = array();
     $stmt->closeCursor();
     return $result;
 }
 /**
  * Closes the cursor, enabling the statement to be executed again.
  *
  * closeCursor() frees up the connection to the server so that other SQL
  * statements may be issued, but leaves the statement in a state that enables
  * it to be executed again.
  *
  * This method is useful for database drivers that do not support executing
  * a PDOStatement object when a previously executed PDOStatement object still
  * has unfetched rows. If your database driver suffers from this limitation,
  * the problem may manifest itself in an out-of-sequence error.
  *
  * @return boolean Returns TRUE on success or FALSE on failure.
  */
 public function closeCursor()
 {
     return $this->statement->closeCursor();
 }