Skip to content

Commit

Permalink
Add QueryRepository::inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Mar 5, 2019
1 parent d81d6ba commit 0a2e968
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/QueryRepository.php
Expand Up @@ -24,6 +24,9 @@ class QueryRepository
*/
protected $mapping;

/**
* @var \Rougin\Windstorm\MixedInterface
*/
protected $mixed = null;

/**
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 0a2e968

Please sign in to comment.