public function testContainerRandomGetRemoveElements() { $container = new Container(); foreach (range(1, 5) as $n) { $container->add(new EBTC(array('id' => $n))); } $container->randomGet(2, null, true); $this->assertSame($container->count(), 3); $container->randomGet(null, null, true); $this->assertSame($container->count(), 2); $container->randomGet(8, null, true); $this->assertSame($container->count(), 0); }
/** * Get all inherited Attributes * @return Container */ public function getChildren() { $output = new BaseContainer(); foreach ($this->getRelation()->getChildren() as $childRelation) { $childAttribute = $childRelation->getAttributeByName($this->name); $output->add($childAttribute, $childAttribute->getChildren()); } return $output; }