[DCOM-96] proxy generation as of doctrine/common#168 #187

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@Ocramius
Doctrine member

See doctrine/common#168, doctrine/doctrine2#406 and doctrine/mongodb-odm#445

Successful build at https://travis-ci.org/Ocramius/phpcr-odm/builds/3156953 (modified composer.json, not included in this PR)

Merging this means bumping requirement of doctrine/common to >=2.4.

@Ocramius Ocramius commented on the diff Nov 11, 2012
lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php
*/
public function hasAssociation($fieldName)
{
+ foreach ($this->associationsMappings as $field) {
@Ocramius
Ocramius Nov 11, 2012

@dbu @lsmith77 as already asked on IRC, I need some feedback on this to define what is a field and what is an association :)

@lsmith77
lsmith77 Nov 16, 2012

what specifically do you need to know here? everything in there is an association. i assume you are asking more about $this->fieldMappings? in there we afaik do not have any associations.

@Ocramius
Ocramius Nov 16, 2012

So these are all to be handled in hasField()?

@lsmith77
lsmith77 Nov 16, 2012

uhm i dont know your patch well enough yet to really answer this .. but i guess fields need to be covered by hasField() :)

@Ocramius
Ocramius Nov 16, 2012

Ok :)

This is basically required to identify what has to be lazy loaded, since that's either a field or an association in doctrine/common.

@dbu
dbu Nov 16, 2012

ok, afaik we currently lazy load all of them: references, referrer, child/children and parent. correct, lukas?

@lsmith77
lsmith77 Nov 16, 2012

collections are lazy loading indeed, though once initialized IIRC they currently then read the entire collection, which maybe one day we want to make more flexible.

@Ocramius
Ocramius Nov 16, 2012

Yes, this is btw about creating the collection object itself (isn't there at proxy instantiation).

Lemme know about what I should move to hasField, since I don't have any idea of what all these funny things mean in PHPCR :P

@lsmith77
lsmith77 Nov 16, 2012

not sure what else you need .. there is $this->fieldMappings which contains the list of fields ..

@Ocramius
Ocramius Nov 16, 2012

@lsmith77 it's just about understanding if associationsMappings, referrersMappings, childrenMappings, parentMapping, node and nodename are fields or associations.

To be more clear, I'd personally consider a field something like an embeddable or a scalar, while an association is probably something pointing to documents that can live on their own.

@lsmith77
lsmith77 Nov 16, 2012

all but node and nodename point to documents or collections of documents. nodename points to a scalar and node points to a low level class instance of a PHPCR node.

@Ocramius
Ocramius Nov 16, 2012

Awesome! That's basically all I needed :)

@Ocramius
Ocramius Jan 4, 2013

This looks already ok in master... Am I wrong?

@lsmith77
lsmith77 Jan 4, 2013

what looks ok in master? you are confusing me :)

@Ocramius
Ocramius Jan 4, 2013

Nvm. Guess it was too late to work on it tonight :)

@Ocramius Ocramius referenced this pull request in doctrine/common Nov 11, 2012
Merged

[DCOM-96] ProxyFactory logic moved to doctrine common #168

@dbu
Doctrine member
dbu commented Dec 6, 2012

is this finished and ready? if so it needs a rebase.

does it include any bc breaks? i guess there might be things that are done more strictly now?

@Ocramius
Doctrine member

@dbu no, it's not yet in common :(

It isn't a break though.

@lsmith77 lsmith77 closed this Jan 10, 2013
@lsmith77 lsmith77 reopened this Jan 10, 2013
@lsmith77
Doctrine member

doh .. looks like this needs a rebase ..

@lsmith77
Doctrine member

closing in favor of #214

@lsmith77 lsmith77 closed this Jan 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment