[RFC] Query Re-usability #267

Closed
jaugustin opened this Issue Jul 25, 2012 · 3 comments

Projects

None yet

3 participants

@jaugustin
Member

Hi,

Today query is great but re-usability is limited, look at this example:

<?php

$query = AuthorQuery::create();

$query->useBookQuery()->filterByDate($date)->endUse();

$query->useBookQuery()->filterByTitle('book of the year 20%')->endUse();

This will fail because propel join twice the same table with the same name. We could add 2 differents alias but this is a nonsense :

<?php

$query = AuthorQuery::create();

$query->useBookQuery('b1')->filterByDate($date)->endUse();

$query->useBookQuery('b2')->filterByTitle('book of the year 20%')->endUse();

the useQuery with no alias or the same alias shouldn't generate a secondary join.

this could henance re-usability and maintainability (for user code).

@fzaninotto
Member

+1

@jaugustin jaugustin was assigned Jul 25, 2012
@jaugustin
Member

@marcj I close this, because it seems to be fixed in both propel 1.7 and propel 2

@jaugustin jaugustin closed this May 2, 2014
@marcj
Member
marcj commented May 2, 2014

ok, cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment