當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。