当前位置: 首页>>代码示例>>PHP>>正文


PHP Collection::offsetExists方法代码示例

本文整理汇总了PHP中Illuminate\Support\Collection::offsetExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::offsetExists方法的具体用法?PHP Collection::offsetExists怎么用?PHP Collection::offsetExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Collection的用法示例。


在下文中一共展示了Collection::offsetExists方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: searchIn

 /**
  * @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');
 }
开发者ID:kodicomponents,项目名称:searcher,代码行数:19,代码来源:Searcher.php

示例2: offsetExists

 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);
     }
 }
开发者ID:dukhanin,项目名称:laravel-menu,代码行数:10,代码来源:MenuCollection.php

示例3: isRegistered

 /**
  * Verify whether a module has been registered
  *
  * @param ModuleInterface $module
  * @return mixed
  */
 public function isRegistered(ModuleInterface $module)
 {
     return $this->modules->offsetExists(get_class($module));
 }
开发者ID:billwaddyjr,项目名称:dashboard,代码行数:10,代码来源:ModuleRepo.php

示例4: testArrayAccessOffsetExists

 public function testArrayAccessOffsetExists()
 {
     $c = new Collection(['foo', 'bar']);
     $this->assertTrue($c->offsetExists(0));
     $this->assertTrue($c->offsetExists(1));
     $this->assertFalse($c->offsetExists(1000));
 }
开发者ID:sa7bi,项目名称:euro16,代码行数:7,代码来源:SupportCollectionTest.php

示例5: hasHandlerForType

 /**
  * @param $type
  * @return bool
  */
 public function hasHandlerForType($type)
 {
     return $this->handlers->offsetExists($type);
 }
开发者ID:unifact,项目名称:connector,代码行数:8,代码来源:Manager.php

示例6: has

 /**
  * 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);
 }
开发者ID:subbly,项目名称:framework,代码行数:13,代码来源:SettingService.php

示例7: offsetExists

 /**
  * @param mixed $offset
  * @return bool
  */
 public function offsetExists($offset)
 {
     return $this->results->offsetExists($offset);
 }
开发者ID:h4rrison,项目名称:PHRETS,代码行数:8,代码来源:Results.php

示例8: offsetExists

 /**
  * 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);
 }
开发者ID:KodiComponents,项目名称:module-datasource,代码行数:18,代码来源:FieldsCollection.php

示例9: offsetExists

 public function offsetExists($key)
 {
     return parent::offsetExists(strtoupper($key));
 }
开发者ID:winkbrace,项目名称:oracle,代码行数:4,代码来源:Row.php


注:本文中的Illuminate\Support\Collection::offsetExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。