Skip to content

Commit

Permalink
Merge pull request #9 from alafon/key-functions-not-private
Browse files Browse the repository at this point in the history
Make it possible to call key functions when extending Dataloader
  • Loading branch information
mcg-web authored Jan 24, 2017
2 parents 55836c8 + c832b53 commit 11c2f80
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/DataLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,24 @@ private static function awaitInstances()
}
}

private function getCacheKeyFromKey($key)
/**
* @param $key
*
* @return mixed
*/
protected function getCacheKeyFromKey($key)
{
$cacheKeyFn = $this->options->getCacheKeyFn();
$cacheKey = $cacheKeyFn ? $cacheKeyFn($key) : $key;

return $cacheKey;
}

private function checkKey($key, $method)
/**
* @param $key
* @param $method
*/
protected function checkKey($key, $method)
{
if (null === $key) {
throw new \InvalidArgumentException(
Expand Down

0 comments on commit 11c2f80

Please sign in to comment.