/** * Adds a prototype to the collection and increments the count. * * @param Prototype $prototype */ public function add(Prototype $prototype) { $prototype->setKey($this->i); $this->collection[] = $prototype; ++$this->i; }