當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Collection::offsetUnset方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Collection::offsetUnset方法的典型用法代碼示例。如果您正苦於以下問題:PHP Collection::offsetUnset方法的具體用法?PHP Collection::offsetUnset怎麽用?PHP Collection::offsetUnset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Collection的用法示例。


在下文中一共展示了Collection::offsetUnset方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: offsetUnset

 public function offsetUnset($key)
 {
     $keySegments = explode('.', $key);
     $firstKeySegment = array_shift($keySegments);
     if ($keySegments && $this->offsetExists($firstKeySegment)) {
         return parent::offsetGet($firstKeySegment)->items()->offsetUnset(implode('.', $keySegments));
     } else {
         return parent::offsetUnset($key);
     }
 }
開發者ID:dukhanin,項目名稱:laravel-menu,代碼行數:10,代碼來源:MenuCollection.php

示例2: deactivatePlugin

 /**
  * @param string $name
  * @param bool   $removeTable
  *
  * @return bool
  */
 public function deactivatePlugin($name, $removeTable = false)
 {
     $status = false;
     if ($this->isActivated($name) and !is_null($plugin = $this->getPluginContainer($name))) {
         $status = $plugin->deactivate($removeTable);
         if (app()->routesAreCached()) {
             Artisan::call('route:cache');
         }
         $plugin->checkActivation();
         $this->activated->offsetUnset(get_class($plugin));
     }
     return $status;
 }
開發者ID:KodiComponents,項目名稱:module-plugins,代碼行數:19,代碼來源:PluginLoader.php

示例3: pushCriteria

 /**
  * @param \Bosnadev\Repositories\Contracts\CriteriaInterface $criteria
  *
  * @return $this
  */
 public function pushCriteria(CriteriaInterface $criteria)
 {
     if ($this->preventCriteriaOverwriting) {
         // Find existing criteria
         $key = $this->criteria->search(function ($item) use($criteria) {
             return is_object($item) and get_class($item) == get_class($criteria);
         });
         // Remove old criteria
         if (is_int($key)) {
             $this->criteria->offsetUnset($key);
         }
     }
     $this->criteria->push($criteria);
     return $this;
 }
開發者ID:scolib,項目名稱:repositories,代碼行數:20,代碼來源:Repository.php

示例4: testArrayAccessOffsetUnset

 /**
  * @expectedException PHPUnit_Framework_Error_Notice
  */
 public function testArrayAccessOffsetUnset()
 {
     $c = new Collection(['foo', 'bar']);
     $c->offsetUnset(1);
     $c[1];
 }
開發者ID:sa7bi,項目名稱:euro16,代碼行數:9,代碼來源:SupportCollectionTest.php

示例5: offsetUnset

 /**
  * @param mixed $offset
  */
 public function offsetUnset($offset)
 {
     $this->results->offsetUnset($offset);
 }
開發者ID:h4rrison,項目名稱:PHRETS,代碼行數:7,代碼來源:Results.php

示例6: offsetUnset

 /**
  * Offset to unset
  * @link http://php.net/manual/en/arrayaccess.offsetunset.php
  *
  * @param mixed $offset <p>
  * The offset to unset.
  * </p>
  *
  * @return void
  * @since 5.0.0
  */
 public function offsetUnset($offset)
 {
     $this->fields->offsetUnset($offset);
 }
開發者ID:KodiComponents,項目名稱:module-datasource,代碼行數:15,代碼來源:FieldsCollection.php

示例7: offsetUnset

 public function offsetUnset($key)
 {
     parent::offsetUnset(strtoupper($key));
 }
開發者ID:winkbrace,項目名稱:oracle,代碼行數:4,代碼來源:Row.php


注:本文中的Illuminate\Support\Collection::offsetUnset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。