Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
#1626: Option to prevent autoinstantiation of foreign records during get() operations
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Doctrine  
View profile   Translate to Translated (View Original)
 More options 30 Oct 2008, 10:16
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Thu, 30 Oct 2008 10:16:38 -0000
Local: Thurs 30 Oct 2008 10:16
Subject: [Doctrine] #1626: Option to prevent autoinstantiation of foreign records during get() operations
#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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile   Translate to Translated (View Original)
 More options 30 Oct 2008, 13:52
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Thu, 30 Oct 2008 13:52:36 -0000
Local: Thurs 30 Oct 2008 13:52
Subject: Re: [Doctrine] #1626: Option to prevent autoinstantiation of foreign records during get() operations
#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                
Resolution:               |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Changes (by adamthehutt):

  * has_patch:  0 => 1

Comment:

 I've attached a patch which seems to add this feature without breaking
 anything (existing tests pass).

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1626#comment:1>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile   Translate to Translated (View Original)
 More options 30 Oct 2008, 15:51
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Thu, 30 Oct 2008 15:51:42 -0000
Local: Thurs 30 Oct 2008 15:51
Subject: Re: [Doctrine] #1626: Option to prevent autoinstantiation of foreign records during get() operations
#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                
Resolution:               |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Comment (by romanb):

 Just as a side note, this behavior will be gone completely in 2.0. No
 auto"magic" object creations behind the scene. We've had enough "WTF?"
 experiences and bugs or bogus bugs with the current behavior. The minor
 convenience this feature offers is not worth it.

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1626#comment:2>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile   Translate to Translated (View Original)
 More options 31 Oct 2008, 10:44
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Fri, 31 Oct 2008 10:44:43 -0000
Local: Fri 31 Oct 2008 10:44
Subject: Re: [Doctrine] #1626: Option to prevent autoinstantiation of foreign records during get() operations
#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                
Resolution:               |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Comment (by adamthehutt):

 romanb - Do you think this can make it into 1.0.5 or 1.1? Have you had a
 chance to look at the patch? I'm not positive it does everything it needs
 to do, but it addresses the primary use case ("hasZeroOrOne" foreign key
 relations).

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1626#comment:3>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile   Translate to Translated (View Original)
 More options 31 Oct 2008, 13:09
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Fri, 31 Oct 2008 13:09:15 -0000
Local: Fri 31 Oct 2008 13:09
Subject: Re: [Doctrine] #1626: Option to prevent autoinstantiation of foreign records during get() operations
#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                
Resolution:               |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Comment (by jwage):

 It would only be possible in 1.1 because it is a new feature.

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1626#comment:4>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Doctrine  
View profile   Translate to Translated (View Original)
 More options 1 Dec 2008, 23:36
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Mon, 01 Dec 2008 23:36:30 -0000
Local: Mon 1 Dec 2008 23:36
Subject: Re: [Doctrine] #1626: Option to prevent autoinstantiation of foreign records during get() operations
#1626: Option to prevent autoinstantiation of foreign records during get()
operations
-----------------------------------+--------------------------------------- -
 Reporter:  adamthehutt            |       Owner:  romanb
     Type:  defect                 |      Status:  new  
 Priority:  major                  |   Milestone:  1.2.0
Component:  Relations              |     Version:  1.0.3
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  1    
-----------------------------------+--------------------------------------- -
Changes (by jwage):

  * milestone:  1.1.0 => 1.2.0

Old description:

> 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.

New description:

 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.

--

Comment:

 Can you provide a patch that shows the individual changes?

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1626#comment:5>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google