diff --git a/src/ORM/Table.php b/src/ORM/Table.php index c138d11cc01..e413b9f9b16 100644 --- a/src/ORM/Table.php +++ b/src/ORM/Table.php @@ -1158,10 +1158,10 @@ public function get($primaryKey, $options = []) $cacheConfig = isset($options['cache']) ? $options['cache'] : false; $cacheKey = isset($options['key']) ? $options['key'] : false; - $finderName = isset($options['finderName']) ? $options['finderName'] : 'all'; - unset($options['key'], $options['cache'], $options['finderName']); + $finder = isset($options['finder']) ? $options['finder'] : 'all'; + unset($options['key'], $options['cache'], $options['finder']); - $query = $this->find($finderName, $options)->where($conditions); + $query = $this->find($finder, $options)->where($conditions); if ($cacheConfig) { if (!$cacheKey) { diff --git a/tests/TestCase/ORM/TableTest.php b/tests/TestCase/ORM/TableTest.php index bbea11d2585..a31387df9da 100644 --- a/tests/TestCase/ORM/TableTest.php +++ b/tests/TestCase/ORM/TableTest.php @@ -3825,7 +3825,7 @@ public function testGet($options) public function providerForTestGetWithCustomFinder() { return [ - [ ['fields' => ['id'], 'finderName' => 'custom'] ] + [ ['fields' => ['id'], 'finder' => 'custom'] ] ]; }