offsetUnset() public method

Unset the item at a given offset.
public offsetUnset ( string $key ) : void
$key string
return void
Example #1
0
 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;
 }
Example #3
0
 /**
  * @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;
 }
Example #4
0
 /**
  * @expectedException PHPUnit_Framework_Error_Notice
  */
 public function testArrayAccessOffsetUnset()
 {
     $c = new Collection(['foo', 'bar']);
     $c->offsetUnset(1);
     $c[1];
 }
Example #5
0
 /**
  * @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);
 }
Example #7
0
 public function offsetUnset($key)
 {
     parent::offsetUnset(strtoupper($key));
 }