本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例4: testArrayAccessOffsetUnset
/**
* @expectedException PHPUnit_Framework_Error_Notice
*/
public function testArrayAccessOffsetUnset()
{
$c = new Collection(['foo', 'bar']);
$c->offsetUnset(1);
$c[1];
}
示例5: offsetUnset
/**
* @param mixed $offset
*/
public function offsetUnset($offset)
{
$this->results->offsetUnset($offset);
}
示例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);
}
示例7: offsetUnset
public function offsetUnset($key)
{
parent::offsetUnset(strtoupper($key));
}