Gc\View\Collection::clearElements PHP Method

clearElements() public method

Clear elements
public clearElements ( ) : Collection
return Collection
    public function clearElements()
    {
        $this->elements = array();
        return $this;
    }

Usage Example

Esempio n. 1
0
 /**
  * Test
  *
  * @return void
  */
 public function testClearElements()
 {
     $model = Model::fromIdentifier('identifier-collection-test');
     $this->object->addElement($model);
     $this->object->clearElements();
     $this->assertEquals(0, count($this->object->getElements()));
 }