postgres.php 501 B

12345678910111213141516171819202122
  1. <?php namespace Laravel\Database\Query;
  2. use Laravel\Database\Query;
  3. class Postgres extends Query {
  4. /**
  5. * Insert an array of values into the database table and return the value of the ID column.
  6. *
  7. * @param array $values
  8. * @return int
  9. */
  10. public function insert_get_id($values)
  11. {
  12. $query = $this->connection->pdo->prepare($this->compiler->insert_get_id($this, $values));
  13. $query->execute(array_values($values));
  14. return (int) $query->fetch(\PDO::FETCH_CLASS, 'stdClass')->id;
  15. }
  16. }