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


PHP SplObjectStorage::offsetUnset方法代码示例

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


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

示例1: offsetUnset

 /**
  * Remove an object from the storage
  * @param object object
  */
 public function offsetUnset($object)
 {
     if (parent::contains($object)) {
         parent::offsetUnset($object);
         $index = array_search(spl_object_hash($object), $this->map, true);
         unset($this->map[$index]);
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:12,代码来源:Storage.php

示例2: unsubscribe

 private function unsubscribe(WebSocketConnection $connection)
 {
     /** @var WebSocketObservableTable $table */
     $table = $this->connectionTableMap->offsetGet($connection);
     $table->removeConnection($connection);
     $this->connectionTableMap->offsetUnset($connection);
     $connections = $this->getConnectionsSubscribedToTable($table)->filter(function (WebSocketConnection $c) use($connection) {
         return $c !== $connection;
     });
     if (count($connections)) {
         $this->tableConnectionMap->offsetSet($table, $connections);
     } else {
         $this->tableConnectionMap->offsetUnset($table);
     }
 }
开发者ID:proof,项目名称:blackjack-php-server,代码行数:15,代码来源:WebSocketManager.php

示例3: 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)
 {
     if (is_scalar($offset)) {
         unset($this->scalarStore[$offset]);
     } else {
         if (is_object($offset)) {
             $this->objectStore->offsetUnset($offset);
         } else {
             if (is_array($offset)) {
                 $index = array_search($offset, $this->arrayKeys, true);
                 if (false !== $index) {
                     array_splice($this->arrayKeys, $index, 1);
                     array_splice($this->arrayValues, $index, 1);
                 }
             }
         }
     }
 }
开发者ID:webonyx,项目名称:graphql-php,代码行数:27,代码来源:MixedStore.php

示例4: offsetUnset

 public function offsetUnset($index)
 {
     $this->validateIndex($index);
     // Decrement counters when replacing existing item
     if (parent::offsetExists($index)) {
         $oldResult = parent::offsetGet($index);
         if ($oldResult instanceof Success) {
             $this->countSuccess--;
         } elseif ($oldResult instanceof Failure) {
             $this->countFailure--;
         } elseif ($oldResult instanceof Warning) {
             $this->countWarning--;
         } else {
             $this->countUnknown--;
         }
     }
     parent::offsetUnset($index);
 }
开发者ID:ralfeggert,项目名称:zftool,代码行数:18,代码来源:Collection.php

示例5: offsetUnset

 public function offsetUnset($object)
 {
     $this->initialize();
     parent::offsetUnset($object);
 }
开发者ID:patrickreck,项目名称:flow-development-collection,代码行数:5,代码来源:LazySplObjectStorage.php

示例6: offsetUnset

 /**
  * @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
  */
 public function offsetUnset($object)
 {
     @trigger_error('The ' . __METHOD__ . ' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
     parent::offsetUnset($object);
 }
开发者ID:0mars,项目名称:symfony,代码行数:8,代码来源:Crawler.php

示例7: offsetUnset

 /**
  * @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
  */
 public function offsetUnset($object)
 {
     $this->triggerDeprecation(__METHOD__);
     parent::offsetUnset($object);
 }
开发者ID:hudsonventura,项目名称:ModularCore,代码行数:8,代码来源:Crawler.php

示例8: offsetUnset

 /**
  * @param object $index
  * @link http://php.net/manual/en/splobjectstorage.offsetunset.php
  */
 public function offsetUnset($index)
 {
     $this->validateIndex($index);
     // Decrement counters when replacing existing item
     if (parent::offsetExists($index)) {
         $this->updateCounters(parent::offsetGet($index), -1);
     }
     parent::offsetUnset($index);
 }
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:13,代码来源:Collection.php

示例9: offsetUnset

 /**
  * @param object $offset
  */
 public function offsetUnset($offset)
 {
     $this->list->offsetUnset($offset);
 }
开发者ID:davidbadura,项目名称:orangedb,代码行数:7,代码来源:ObjectCollection.php


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