/** * @param string|Model $model * @param string $query * @param int|null $perPage * @param string $pageName * * @return LengthAwarePaginator|Collection * @throws \Exception */ public function searchIn($model, $query = "", $perPage = null, $pageName = 'page') { if ($model instanceof Model) { $model = get_class($model); } if (!$this->models->offsetExists($model)) { throw new \Exception("Search engine for model [{$model}] not found"); } return $this->_search([$this->models->get($model)], $query = "", $perPage = null, $pageName = 'page'); }
public function offsetExists($key) { $keySegments = explode('.', $key); $firstKeySegment = array_shift($keySegments); if ($keySegments && $this->offsetExists($firstKeySegment)) { return parent::offsetGet($firstKeySegment)->items()->offsetExists(implode('.', $keySegments)); } else { return parent::offsetExists($key); } }
/** * Verify whether a module has been registered * * @param ModuleInterface $module * @return mixed */ public function isRegistered(ModuleInterface $module) { return $this->modules->offsetExists(get_class($module)); }
public function testArrayAccessOffsetExists() { $c = new Collection(['foo', 'bar']); $this->assertTrue($c->offsetExists(0)); $this->assertTrue($c->offsetExists(1)); $this->assertFalse($c->offsetExists(1000)); }
/** * @param $type * @return bool */ public function hasHandlerForType($type) { return $this->handlers->offsetExists($type); }
/** * Ask if a setting key exists or not. * * @param string $key The setting key * * @return boolean * * @api */ public function has($key) { return $this->defaults->offsetExists($key); }
/** * @param mixed $offset * @return bool */ public function offsetExists($offset) { return $this->results->offsetExists($offset); }
/** * Whether a offset exists * @link http://php.net/manual/en/arrayaccess.offsetexists.php * * @param mixed $offset <p> * An offset to check for. * </p> * * @return boolean true on success or false on failure. * </p> * <p> * The return value will be casted to boolean if non-boolean was returned. * @since 5.0.0 */ public function offsetExists($offset) { return $this->fields->offsetExists($offset); }
public function offsetExists($key) { return parent::offsetExists(strtoupper($key)); }