When I have select from many tables, for second and other tables I
must write all theirs columns and make aliases for them - it isn't
comfortable, I can make table_name.* to take all columns only for
first table, for others I can't - for example:
public function pobierzDaneDoWygenerowaniaPromocji()
{
$q = Doctrine_Query::create()
->select('t.*, a.name_airline as name_airline, a.promotion as
promotion)
->from('Travel t')
->innerJoin('t.Airline a');
If you dont use the method ->select() to tell what to bring, it will
understand that you want all fields .. once you are trying to select
table1.*, table2.*, i think thats more confortable not using the method
->select();
example:
public function pobierzDaneDoWygenerowaniaPromocji()
{
$q = Doctrine_Query::create()
->from('Travel t')
->innerJoin('t.Airline a');
> When I have select from many tables, for second and other tables I
> must write all theirs columns and make aliases for them - it isn't
> comfortable, I can make table_name.* to take all columns only for
> first table, for others I can't - for example:
> public function pobierzDaneDoWygenerowaniaPromocji()
> {
> $q = Doctrine_Query::create()
> ->select('t.*, a.name_airline as name_airline, a.promotion as
> promotion)
> ->from('Travel t')
> ->innerJoin('t.Airline a');
> return $q->execute();
> }
> Is other way, because it isn't comfortable ?????
> If you dont use the method ->select() to tell what to bring, it will
> understand that you want all fields .. once you are trying to select
> table1.*, table2.*, i think thats more confortable not using the method
> ->select();
> example:
> public function pobierzDaneDoWygenerowaniaPromocji()
> {
> $q = Doctrine_Query::create()
> ->from('Travel t')
> ->innerJoin('t.Airline a');
> > When I have select from many tables, for second and other tables I
> > must write all theirs columns and make aliases for them - it isn't
> > comfortable, I can make table_name.* to take all columns only for
> > first table, for others I can't - for example:
> > public function pobierzDaneDoWygenerowaniaPromocji()
> > {
> > $q = Doctrine_Query::create()
> > ->select('t.*, a.name_airline as name_airline, a.promotion as
> > promotion)
> > ->from('Travel t')
> > ->innerJoin('t.Airline a');
> > return $q->execute();
> > }
> > Is other way, because it isn't comfortable ?????
if you use hydrate array then, the fields will be organized in indexes, if
you use scalar, the alias of the table will be the part of the name of the
field, example: a_id_tableA, a_id_tableB, b_id_tableB
> public function someFunction()
> {
> $q = Doctrine_Query::create()
> ->from('TableA a')
> ->innerJoin('a.tableB b')
> ->innerJoin('a.tableC c');
> return $q->execute();
> }
> How can I then show records ?
> On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > If you dont use the method ->select() to tell what to bring, it will
> > understand that you want all fields .. once you are trying to select
> > table1.*, table2.*, i think thats more confortable not using the method
> > ->select();
> > > When I have select from many tables, for second and other tables I
> > > must write all theirs columns and make aliases for them - it isn't
> > > comfortable, I can make table_name.* to take all columns only for
> > > first table, for others I can't - for example:
> > > public function pobierzDaneDoWygenerowaniaPromocji()
> > > {
> > > $q = Doctrine_Query::create()
> > > ->select('t.*, a.name_airline as name_airline, a.promotion as
> > > promotion)
> > > ->from('Travel t')
> > > ->innerJoin('t.Airline a');
> > > return $q->execute();
> > > }
> > > Is other way, because it isn't comfortable ?????
> if you use hydrate array then, the fields will be organized in indexes, if
> you use scalar, the alias of the table will be the part of the name of the
> field, example: a_id_tableA, a_id_tableB, b_id_tableB
> > On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > If you dont use the method ->select() to tell what to bring, it will
> > > understand that you want all fields .. once you are trying to select
> > > table1.*, table2.*, i think thats more confortable not using the method
> > > ->select();
> > > > When I have select from many tables, for second and other tables I
> > > > must write all theirs columns and make aliases for them - it isn't
> > > > comfortable, I can make table_name.* to take all columns only for
> > > > first table, for others I can't - for example:
Its because $x does not have a columnB .. $x is a record from TableA, you
have to get the child element .. every innerJoin table has a child element
..
Use, ->setHydrationMode(Doctrine::HYDRATE_ARRAY) in your dql, and then
print_r the result .. you will understand.
> On 6 Lis, 16:21, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > if you use hydrate array then, the fields will be organized in indexes,
> if
> > you use scalar, the alias of the table will be the part of the name of
> the
> > field, example: a_id_tableA, a_id_tableB, b_id_tableB
> > > On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > > If you dont use the method ->select() to tell what to bring, it will
> > > > understand that you want all fields .. once you are trying to select
> > > > table1.*, table2.*, i think thats more confortable not using the
> method
> > > > ->select();
> > > > > When I have select from many tables, for second and other tables I
> > > > > must write all theirs columns and make aliases for them - it isn't
> > > > > comfortable, I can make table_name.* to take all columns only for
> > > > > first table, for others I can't - for example:
> Its because $x does not have a columnB .. $x is a record from TableA, you
> have to get the child element .. every innerJoin table has a child element
> ..
> Use, ->setHydrationMode(Doctrine::HYDRATE_ARRAY) in your dql, and then
> print_r the result .. you will understand.
> > On 6 Lis, 16:21, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > if you use hydrate array then, the fields will be organized in indexes,
> > if
> > > you use scalar, the alias of the table will be the part of the name of
> > the
> > > field, example: a_id_tableA, a_id_tableB, b_id_tableB
> > > > On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > > > If you dont use the method ->select() to tell what to bring, it will
> > > > > understand that you want all fields .. once you are trying to select
> > > > > table1.*, table2.*, i think thats more confortable not using the
> > method
> > > > > ->select();
> > > > > > When I have select from many tables, for second and other tables I
> > > > > > must write all theirs columns and make aliases for them - it isn't
> > > > > > comfortable, I can make table_name.* to take all columns only for
> > > > > > first table, for others I can't - for example:
> I understand but I don't know how can I in that case make loop. The
> problem is that table TableA has 2 FK, please help with loop.
> On 6 Lis, 18:08, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > Its because $x does not have a columnB .. $x is a record from TableA, you
> > have to get the child element .. every innerJoin table has a child
> element
> > ..
> > Use, ->setHydrationMode(Doctrine::HYDRATE_ARRAY) in your dql, and then
> > print_r the result .. you will understand.
> > > On 6 Lis, 16:21, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > > if you use hydrate array then, the fields will be organized in
> indexes,
> > > if
> > > > you use scalar, the alias of the table will be the part of the name
> of
> > > the
> > > > field, example: a_id_tableA, a_id_tableB, b_id_tableB
> > > > > On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com>
> wrote:
> > > > > > If you dont use the method ->select() to tell what to bring, it
> will
> > > > > > understand that you want all fields .. once you are trying to
> select
> > > > > > table1.*, table2.*, i think thats more confortable not using the
> > > method
> > > > > > ->select();
> > > > > > > When I have select from many tables, for second and other
> tables I
> > > > > > > must write all theirs columns and make aliases for them - it
> isn't
> > > > > > > comfortable, I can make table_name.* to take all columns only
> for
> > > > > > > first table, for others I can't - for example:
> > I understand but I don't know how can I in that case make loop. The
> > problem is that table TableA has 2 FK, please help with loop.
> > On 6 Lis, 18:08, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > Its because $x does not have a columnB .. $x is a record from TableA, you
> > > have to get the child element .. every innerJoin table has a child
> > element
> > > ..
> > > Use, ->setHydrationMode(Doctrine::HYDRATE_ARRAY) in your dql, and then
> > > print_r the result .. you will understand.
> > > > On 6 Lis, 16:21, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > > > if you use hydrate array then, the fields will be organized in
> > indexes,
> > > > if
> > > > > you use scalar, the alias of the table will be the part of the name
> > of
> > > > the
> > > > > field, example: a_id_tableA, a_id_tableB, b_id_tableB
> > > > > > On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com>
> > wrote:
> > > > > > > If you dont use the method ->select() to tell what to bring, it
> > will
> > > > > > > understand that you want all fields .. once you are trying to
> > select
> > > > > > > table1.*, table2.*, i think thats more confortable not using the
> > > > method
> > > > > > > ->select();
> > > > > > > > When I have select from many tables, for second and other
> > tables I
> > > > > > > > must write all theirs columns and make aliases for them - it
> > isn't
> > > > > > > > comfortable, I can make table_name.* to take all columns only
> > for
> > > > > > > > first table, for others I can't - for example:
> > > I understand but I don't know how can I in that case make loop. The
> > > problem is that table TableA has 2 FK, please help with loop.
> > > On 6 Lis, 18:08, Daniel Santos Bathke <danielbat...@gmail.com> wrote:
> > > > Its because $x does not have a columnB .. $x is a record from TableA,
> you
> > > > have to get the child element .. every innerJoin table has a child
> > > element
> > > > ..
> > > > Use, ->setHydrationMode(Doctrine::HYDRATE_ARRAY) in your dql, and
> then
> > > > print_r the result .. you will understand.
> > > > > On 6 Lis, 16:21, Daniel Santos Bathke <danielbat...@gmail.com>
> wrote:
> > > > > > if you use hydrate array then, the fields will be organized in
> > > indexes,
> > > > > if
> > > > > > you use scalar, the alias of the table will be the part of the
> name
> > > of
> > > > > the
> > > > > > field, example: a_id_tableA, a_id_tableB, b_id_tableB
> > > > > > > On 6 Lis, 14:33, Daniel Santos Bathke <danielbat...@gmail.com>
> > > wrote:
> > > > > > > > If you dont use the method ->select() to tell what to bring,
> it
> > > will
> > > > > > > > understand that you want all fields .. once you are trying to
> > > select
> > > > > > > > table1.*, table2.*, i think thats more confortable not using
> the
> > > > > method
> > > > > > > > ->select();
> > > > > > > > > When I have select from many tables, for second and other
> > > tables I
> > > > > > > > > must write all theirs columns and make aliases for them -
> it
> > > isn't
> > > > > > > > > comfortable, I can make table_name.* to take all columns
> only
> > > for
> > > > > > > > > first table, for others I can't - for example:
ROUTY this is it what I needed - now I understand - THX SO MUCH !! YOU
ARE GREAT !!
As I find also on this site: http://www.symfony-project.org/doctrine/1_2/en/06-Working-With-Data $q->execute(array(), Doctrine::HYDRATE_ARRAY) == $q->fetchArray()
so I use fetchArray() but without Your example I didn't know what to
do - THX AND THX AGAIN :)
Of cours thx also for Daniel :)
THX PEOPLE !!!
On 6 Lis, 20:57, Routy <nickro...@gmail.com> wrote: