src/Sulu/Component/Content/Metadata/ItemMetadata.php
public function addChild(self $child)
    {
        if (isset($this->children[$child->name])) {
            throw new \InvalidArgumentException(sprintf(
                'Child with key "%s" already exists',
                $child->name
            ));
        }

        $this->children[$child->name] = $child;
    }
public function addChild(self $child)
    {
        if (isset($this->children[$child->name])) {
            throw new \InvalidArgumentException(sprintf(
                'Child with key "%s" already exists',
                $child->name
            ));
        }

        $this->children[$child->name] = $child;
    }
public function addChild ( self $ child ) { if ( isset ( $ this -> children [ $ child -> name ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Child with key "%s" already exists' , $ child -> name ) ) ; } $ this -> children [ $ child -> name ] = $ child ; }
Adds a child item.

@param ItemMetadata $child
Adds a child item .