Продвигайте, добавляйте псевдоним для оператора select


Я использую propel master-dev с symfony 2.1. Можно ли написать что-то подобное? Иначе как я могу добавить псевдоним в инструкцию select.

    $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();
Author: j0k, 2012-06-19

1 answers

Решено:

    $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();
 9
Author: originof, 2012-06-19 10:53:07