public function put($name, $value)
    {
        if (is_object($value) && !$this->isValidObjectInstance($value)) {
            throw new InvalidCollectionItemInstanceException(sprintf('%s must implement %s', $name, $this->classname));
        }

        $this->items[$name] = $value;

        return $this->items[$name];
    }
public function put($name, $value)
    {
        if (is_object($value) && !$this->isValidObjectInstance($value)) {
            throw new InvalidCollectionItemInstanceException(sprintf('%s must implement %s', $name, $this->classname));
        }

        $this->items[$name] = $value;

        return $this->items[$name];
    }
public function put ( $ name , $ value ) { if ( is_object ( $ value ) && ! $ this -> isValidObjectInstance ( $ value ) ) { throw new InvalidCollectionItemInstanceException ( sprintf ( '%s must implement %s' , $ name , $ this -> classname ) ) ; } $ this -> items [ $ name ] = $ value ; return $ this -> items [ $ name ] ; }
Add a new item to collection.

@param string $name
@param mixed  $value

@return self
Add a new item to collection .