From 0a2e9689d46ac6b361d7e5ab0fb3dfeba4fdcace Mon Sep 17 00:00:00 2001 From: Rougin Gutib Date: Wed, 6 Mar 2019 07:46:28 +0800 Subject: [PATCH] Add QueryRepository::inserted --- src/QueryRepository.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/QueryRepository.php b/src/QueryRepository.php index 79327af..8c1a265 100644 --- a/src/QueryRepository.php +++ b/src/QueryRepository.php @@ -24,6 +24,9 @@ class QueryRepository */ protected $mapping; + /** + * @var \Rougin\Windstorm\MixedInterface + */ protected $mixed = null; /** @@ -87,6 +90,16 @@ public function first() return $item; } + /** + * Returns the last inserted ID. + * + * @return integer + */ + public function inserted() + { + return $this->execute($this->query)->inserted(); + } + /** * Returns all items from the result. *