2012-06-19 17 views
5

चुनने के लिए उपनाम जोड़ें मैं symfony 2.1 के साथ प्रोपेल मास्टर-देव का उपयोग कर रहा हूं। ऐसा कुछ लिखना संभव है? अन्यथा मैं चयन कथन में उपनाम कैसे जोड़ सकता हूं।प्रस्ताव, चयन कथन

$products = ProdottinewQuery::create() 
     ->leftJoinWith('Prodotticolori') 
     ->leftJoinWith('Alberocategorie') 
     ->leftJoinWith('Brand') 
     ->leftJoinWith('Prodottimateriali') 
     ->leftJoinWith('Prodottigroffatura') 
     ->select(array('id', 
        'codice', 
        'nomeEng', 
        'Alberocategorie.nomeeng' => 'category', 
        'Prodotticolori.coloreeng' => 'color', 
        'Brand.brand' => 'brand', 
        'Prodottimateriali.materialeeng' => 'material', 
        'Prodottigroffatura.groffaturaeng' => 'groffage')) 
     ->orderById() 
     ->limit($howmany) 
     ->find(); 

उत्तर

9

हल:

$products = ProdottinewQuery::create() 
     ->leftJoinWith('Prodotticolori') 
     ->leftJoinWith('Alberocategorie') 
     ->leftJoinWith('Brand') 
     ->leftJoinWith('Prodottimateriali') 
     ->leftJoinWith('Prodottigroffatura') 
     ->select(array('id', 
        'codice', 
        'nomeEng')) 
     ->withColumn('Alberocategorie.nomeeng', 'category') 
     ->withColumn('Prodotticolori.coloreeng', 'color') 
     ->withColumn('Brand.brand', 'brand') 
     ->withColumn('Prodottimateriali.materialeeng', 'material') 
     ->withColumn('Prodottigroffatura.groffaturaeng', 'groffage') 
     ->orderById() 
     ->limit($howmany) 
     ->find(); 
संबंधित मुद्दे