dudapiotr / ZfTable

*Not supported*ZfTable 3.1. Awesome ZF2 table / grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.
http://dudapiotrek.laohost.net/
MIT License
75 stars 59 forks source link

Improve.source.doctrine.qb #44

Closed olekhy closed 9 years ago

olekhy commented 9 years ago

As an idea for simply field aliasing for doctrine query builder:

at configure grid $headers it's not possible to set column names from JOINED tables because this one could have same names as in root table.

user :name

country :name


'name' => [
    'tableAlias' => 'c',
    'title' => $translator->translate('Company'),
    'filters' => 'text',
],
'postCode' => [
    'tableAlias' => 'a',
    'title' => $translator->translate('Post code'),
    'filters' => 'text',
    'width' => 100
],
'city' => [
    'tableAlias' => 'a',
    'title' => $translator->translate('City'),
    'filters' => 'text',
],
'country' => [ // here is a problem we need a name of company and can not
    'tableAlias' => 'l.name', // this is new in Doctrine QB at order() used as is no needed concatenate country string from header name
    'title' => $translator->translate('Country'),
    'filters' => 'text',
],

specially for ordering, filters used only if any exists in user land code.