public function add(Prototype $prototype)
    {
        if ($this->has($prototype->getKey())) {
            throw new \Exception(sprintf('A prototype with the key %s already exists', $prototype->getKey()));
        }

        $this->collection[] = $prototype;
    }
public function add(Prototype $prototype)
    {
        if ($this->has($prototype->getKey())) {
            throw new \Exception(sprintf('A prototype with the key %s already exists', $prototype->getKey()));
        }

        $this->collection[] = $prototype;
    }
public function add ( Prototype $ prototype ) { if ( $ this -> has ( $ prototype -> getKey ( ) ) ) { throw new \ Exception ( sprintf ( 'A prototype with the key %s already exists' , $ prototype -> getKey ( ) ) ) ; } $ this -> collection [ ] = $ prototype ; }
Adds a prototype to the collection and increments the count.

@param Prototype $prototype

@throws \Exception If the a prototype with the current key already exists
Adds a prototype to the collection and increments the count .