/** * {@inheritdoc} * * @param \Versatile\Search\Contracts\Criteria $criteria * @return \Versatile\Search\Contracts\Search **/ public function search(CriteriaContract $criteria) { if ($factory = $this->nearestForClass($criteria->modelClass())) { return call_user_func($factory, $criteria); } throw new OutOfBoundsException('No factory for ' . $criteria->modelClass() . ' found'); }
/** * Return the root model class name, so that types, titles, etc. can be * introspected * * @return string **/ public function modelClass() { return $this->criteria->modelClass(); }