public function generateWithSource($id,$idChain,$name,$output,array $options = []) {
        if(!$this->adapter){
            throw new RuntimeException(sprintf("The adapter must be set for enable this feature."));
        }
        $chainModel = $this->getChainModel($idChain);
        $className = $chainModel->getClassName();
        $entity = $this->adapter->find($chainModel->getClassName(),$id);
        if(!$entity){
            throw new RuntimeException(sprintf("The source '%s' with '%s' not found.",$className,$id));
        }
        $options["data"]["entity"] = $entity;
        $options["data"]["output"] = $output;
        $options["data"]["name"] = $this->trans($name,[],'labels');
        if($entity instanceof \Tecnocreaciones\Bundle\ToolsBundle\Service\SequenceGenerator\ItemReferenceInterface){
            $options["data"]["%ref%"] = $entity->getRef();
        }
        
        $options["sub_path"] = $id;
        return $this->generate($idChain, $name,$options);
    }
public function generateWithSource($id,$idChain,$name,$output,array $options = []) {
        if(!$this->adapter){
            throw new RuntimeException(sprintf("The adapter must be set for enable this feature."));
        }
        $chainModel = $this->getChainModel($idChain);
        $className = $chainModel->getClassName();
        $entity = $this->adapter->find($chainModel->getClassName(),$id);
        if(!$entity){
            throw new RuntimeException(sprintf("The source '%s' with '%s' not found.",$className,$id));
        }
        $options["data"]["entity"] = $entity;
        $options["data"]["output"] = $output;
        $options["data"]["name"] = $this->trans($name,[],'labels');
        if($entity instanceof \Tecnocreaciones\Bundle\ToolsBundle\Service\SequenceGenerator\ItemReferenceInterface){
            $options["data"]["%ref%"] = $entity->getRef();
        }
        
        $options["sub_path"] = $id;
        return $this->generate($idChain, $name,$options);
    }
public function generateWithSource ( $ id , $ idChain , $ name , $ output , array $ options = [ ] ) { if ( ! $ this -> adapter ) { throw new RuntimeException ( sprintf ( "The adapter must be set for enable this feature." ) ) ; } $ chainModel = $ this -> getChainModel ( $ idChain ) ; $ className = $ chainModel -> getClassName ( ) ; $ entity = $ this -> adapter -> find ( $ chainModel -> getClassName ( ) , $ id ) ; if ( ! $ entity ) { throw new RuntimeException ( sprintf ( "The source '%s' with '%s' not found." , $ className , $ id ) ) ; } $ options [ "data" ] [ "entity" ] = $ entity ; $ options [ "data" ] [ "output" ] = $ output ; $ options [ "data" ] [ "name" ] = $ this -> trans ( $ name , [ ] , 'labels' ) ; if ( $ entity instanceof \ Tecnocreaciones \ Bundle \ ToolsBundle \ Service \ SequenceGenerator \ ItemReferenceInterface ) { $ options [ "data" ] [ "%ref%" ] = $ entity -> getRef ( ) ; } $ options [ "sub_path" ] = $ id ; return $ this -> generate ( $ idChain , $ name , $ options ) ; }
Genera un documento a partir de un id
@param type $id
@param type $idChain
@param type $name
@param array $options
@return string La ruta del archivo generado
@throws RuntimeException
Genera un documento a partir de un id