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); } }
/** * @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; }
/** * @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; }
/** * @expectedException PHPUnit_Framework_Error_Notice */ public function testArrayAccessOffsetUnset() { $c = new Collection(['foo', 'bar']); $c->offsetUnset(1); $c[1]; }
/** * @param mixed $offset */ public function offsetUnset($offset) { $this->results->offsetUnset($offset); }
/** * 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); }
public function offsetUnset($key) { parent::offsetUnset(strtoupper($key)); }