affectedRows = null; return parent::execute($params); } /** * @inheritDoc */ public function rowCount(): int { if ($this->affectedRows !== null) { return $this->affectedRows; } if ( $this->statement->queryString && preg_match('/^(?:DELETE|UPDATE|INSERT)/i', $this->statement->queryString) ) { $changes = $this->_driver->prepare('SELECT CHANGES()'); $changes->execute(); $row = $changes->fetch(); $this->affectedRows = $row ? (int)$row[0] : 0; } else { $this->affectedRows = parent::rowCount(); } return $this->affectedRows; } }