Added fix/option to use absolute namespace while generating base query class #748

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

thedave80 commented Aug 28, 2013

Propel generates something like this as magic method:

  • @method Changelog findOneByChangeNumber(string $change_number) Return the first Changelog filtered by the change_number column

While using a namespace (ORM in this case) at the start of the file:
namespace ORM\om;

Hence the return type will be misinterpreted as ORM\om\Changelog, the correct namespace would be ORM\Changelog. As a workaround I added an build property to always use absolute namespaces.

You need the following line to your build.properties
propel.namespace.useAbsolute = true

thedave80 added some commits Aug 28, 2013

@thedave80 thedave80 Added fix/option to use absolute namespace while generating base quer…
…y class

You need the following line to your build.properties
propel.namespace.useAbsolute = true
e4e39d5
@thedave80 thedave80 Further improvements of query builder class for: leftJoin, rightJoin,…
… innerJoin, orderBy and groupBy
243cdf4
Owner

willdurand commented Sep 1, 2013

Anyone?

Member

staabm commented Sep 2, 2013

not sure about this one. shouldn't a import be generated at the top of the file? Haven't tested it though.

Contributor

thedave80 commented Sep 2, 2013

@staabm Yes. This is the case. But when using a namespaced propel entity in a non-namespaced project (like ZF1) you need to use global-namespaced return types in the magic methods. Hence the workaround.

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