public function addFragment(Fragment $fragment)
    {
        if (!empty($this->fields)) {
            $fragment->filter($this->fields);
        }
        $this->fragmentBag->addFragment($fragment);

        return $this;
    }
public function addFragment(Fragment $fragment)
    {
        if (!empty($this->fields)) {
            $fragment->filter($this->fields);
        }
        $this->fragmentBag->addFragment($fragment);

        return $this;
    }
public function addFragment ( Fragment $ fragment ) { if ( ! empty ( $ this -> fields ) ) { $ fragment -> filter ( $ this -> fields ) ; } $ this -> fragmentBag -> addFragment ( $ fragment ) ; return $ this ; }
Add a new fragment

@param  \Thelia\Core\Hook\Fragment $fragment
@return $this
Add a new fragment