本文整理汇总了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]);
}
}
示例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);
}
}
示例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);
}
}
}
}
}
示例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);
}
示例5: offsetUnset
public function offsetUnset($object)
{
$this->initialize();
parent::offsetUnset($object);
}
示例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);
}
示例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);
}
示例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);
}
示例9: offsetUnset
/**
* @param object $offset
*/
public function offsetUnset($offset)
{
$this->list->offsetUnset($offset);
}