/**
* Handle the "find by" when multiple are requested
*
* @param string $name Name of function called
* @param array $args Arguments list
* @param array $matches Matches from regex
* @return \Modler\Collection collection
*/
public function handleFindByMultiple($name, $args, $matches)
{
$data = isset($args[0]) ? $args[0] : array();
$model = substr($name, 0, strlen($name) - 1);
$collectionNs = '\\Psecio\\Gatekeeper\\' . $model . 'Collection';
if (!class_exists($collectionNs)) {
throw new \Psecio\Gatekepper\Exception\ModelNotFoundException('Collection type ' . $model . ' could not be found');
}
$model = g::modelFactory($model . 'Model');
$collection = new $collectionNs($this->getDb());
$collection = $this->getDb()->find($model, $data, true);
return $collection;
}