#1626: Option to prevent autoinstantiation of foreign records during get()
operations
-----------------------------------+----------------------------------------
Reporter: adamthehutt | Owner: romanb
Type: defect | Status: new
Priority: major | Milestone: 1.1.0
Component: Relations | Version: 1.0.3
Keywords: | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
By default, accessing $record->Related automatically instantiates a new
related Record object if one doesn't already exist. This is not always the
desired behavior, especially in cases where the related record is
"optional" (i.e. 1 to 0/1).
There should be an 'autoInstantiate' option when defining a hasOne()
relationship. For backwards compatability, the default behavior should not
change. But if one sets 'autoInstantiate' => false, then a non-existing
related object must be explicitly created.
I'm working on a test and patch for this, which I'll attach when I have
them.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1626>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---