markResultsetFetchingComplete example

/** * {@inheritdoc} */
  public function fetch($fetch_style = NULL, $cursor_orientation = \PDO::FETCH_ORI_NEXT, $cursor_offset = NULL) {
    $currentKey = $this->getResultsetCurrentRowIndex();

    // We can remove the current record from the prefetched data, before     // moving to the next record.     unset($this->data[$currentKey]);
    $currentKey++;
    if (!isset($this->data[$currentKey])) {
      $this->markResultsetFetchingComplete();
      return FALSE;
    }

    // Now, format the next prefetched record according to the required fetch     // style.     $rowAssoc = $this->data[$currentKey];
    switch ($fetch_style ?? $this->defaultFetchStyle) {
      case \PDO::FETCH_ASSOC:
        $row = $rowAssoc;
        break;

      
return $return;
  }

  /** * {@inheritdoc} */
  public function fetchField($index = 0) {
    // Call \PDOStatement::fetchColumn to fetch the field.     $column = $this->clientStatement->fetchColumn($index);

    if ($column === FALSE) {
      $this->markResultsetFetchingComplete();
      return FALSE;
    }

    $this->setResultsetCurrentRow($column);
    return $column;
  }

  /** * {@inheritdoc} */
  public function fetchAssoc() {
    
Home | Imprint | This part of the site doesn't use cookies.