public function addPageLink(PageLink $link, $index = null) {
        if ($index) {
            $this->links->add($index, $link);
        } else {
            $this->links->push($link);
        }
        return $this->links->count();
    }
public function addPageLink(PageLink $link, $index = null) {
        if ($index) {
            $this->links->add($index, $link);
        } else {
            $this->links->push($link);
        }
        return $this->links->count();
    }
public function addPageLink ( PageLink $ link , $ index = null ) { if ( $ index ) { $ this -> links -> add ( $ index , $ link ) ; } else { $ this -> links -> push ( $ link ) ; } return $ this -> links -> count ( ) ; }
Inserts a new page link into the list

@param  PageLink $link  The link to insert
@param  int      $index Optional index to insert the link at (if not the link will be added at the end)

@return int      The new size
Inserts a new page link into the list