public function setPieces($pieces)
    {
        if ($pieces && !$pieces instanceof PieceBag) {
            $pieces = new PieceBag(is_array($pieces) ? $pieces : []);
        }
        return $this->setParameter('pieces', $pieces);
    }