1
0
mirror of https://github.com/danog/postgres.git synced 2024-12-02 09:27:54 +01:00
postgres/src/PqCommandResult.php
2018-09-26 09:26:49 -05:00

29 lines
574 B
PHP

<?php
namespace Amp\Postgres;
use Amp\Sql\CommandResult;
use pq;
final class PqCommandResult implements CommandResult
{
/** @var \pq\Result PostgreSQL result object. */
private $result;
/**
* @param \pq\Result $result PostgreSQL result object.
*/
public function __construct(pq\Result $result)
{
$this->result = $result;
}
/**
* @return int Number of rows affected by the INSERT, UPDATE, or DELETE query.
*/
public function getAffectedRowCount(): int
{
return $this->result->affectedRows;
}
}