public function add($name, ItemInterface $item)
    {
        if (isset($this->relationships[$name]) === false) {
            $this->relationships[$name] = [];
        }

        unset($this->relationships[$name][$item->getId()]);

        $this->relationships[$name][$item->getId()] = $item;
    }
public function add($name, ItemInterface $item)
    {
        if (isset($this->relationships[$name]) === false) {
            $this->relationships[$name] = [];
        }

        unset($this->relationships[$name][$item->getId()]);

        $this->relationships[$name][$item->getId()] = $item;
    }
public function add ( $ name , ItemInterface $ item ) { if ( isset ( $ this -> relationships [ $ name ] ) === false ) { $ this -> relationships [ $ name ] = [ ] ; } unset ( $ this -> relationships [ $ name ] [ $ item -> getId ( ) ] ) ; $ this -> relationships [ $ name ] [ $ item -> getId ( ) ] = $ item ; }
Adds a relationship.

@param string                                         $name The relationship name
@param Yosymfony\Spress\Core\DataSource\ItemInterface $item An item
Adds a relationship .