setResultsetCurrentRow example


  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() {
    return $this->fetch(\PDO::FETCH_ASSOC);
  }

  /** * {@inheritdoc} */
else {
          return FALSE;
        }
        break;

    }
    // @todo in Drupal 11, throw an exception if $row is undefined at this     // point.     if (!isset($row)) {
      return FALSE;
    }
    $this->setResultsetCurrentRow($row);
    return $row;
  }

  /** * {@inheritdoc} */
  public function fetchColumn($index = 0) {
    if ($row = $this->fetch(\PDO::FETCH_ASSOC)) {
      return $row[$this->columnNames[$index]];
    }
    return FALSE;
  }
Home | Imprint | This part of the site doesn't use cookies.