Skip to content

Commit

Permalink
Allow for custom finder name in Table::get().
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpustulka committed Jul 21, 2015
1 parent 7af3fa1 commit 0e24f36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ORM/Table.php
Expand Up @@ -1158,9 +1158,10 @@ public function get($primaryKey, $options = [])

$cacheConfig = isset($options['cache']) ? $options['cache'] : false;
$cacheKey = isset($options['key']) ? $options['key'] : false;
unset($options['key'], $options['cache']);
$finderName = isset($options['finderName']) ? $options['finderName'] : 'all';
unset($options['key'], $options['cache'], $options['finderName']);

$query = $this->find('all', $options)->where($conditions);
$query = $this->find($finderName, $options)->where($conditions);

if ($cacheConfig) {
if (!$cacheKey) {
Expand Down

0 comments on commit 0e24f36

Please sign in to comment.