Web Images Videos Maps News Shopping Google Mail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable listener at runtime
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
  5 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 21 Oct 2008, 10:42
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Tue, 21 Oct 2008 09:42:30 -0000
Local: Tues 21 Oct 2008 10:42
Subject: [Doctrine] #1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable listener at runtime
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to  dis-/enable
listener at runtime
---------------------------------------+----------------------------------- -
 Reporter:  su                         |       Owner:  romanb
     Type:  enhancement                |      Status:  new    
 Priority:  minor                      |   Milestone:  Unknown
Component:  Record                     |     Version:  1.0.3  
 Keywords:  record, listener, runtime  |    Has_test:  0      
 Mystatus:  Pending Core Response      |   Has_patch:  1      
---------------------------------------+----------------------------------- -
 As discussed in the mailing-list, I attached a patch which adds a
 $_options class var + getter/setter method to the Doctrine_Record_Listener
 class, which would give us the opportunity to dis-/enable record listener
 at runtime.

 This solution is working if the Listener are checking their options array
 at the corresponding hooks like the bundled Timstampable listener and many
 others does.

 Example code to disable the timestampable (in this example the first
 attached listener) listener at runtime with the applied patch:
 {{{
 // get the first (in our case the timstampable) listener for the record
 $timestampable = $record->getListener()->get(0);

 // disable setting of created_at at the timestampable listener
 $timestampable->setOption(array('created' => array('disabled' => true)));
 }}}

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1590>
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 21 Oct 2008, 18:36
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Tue, 21 Oct 2008 17:36:49 -0000
Local: Tues 21 Oct 2008 18:36
Subject: Re: [Doctrine] #1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable listener at runtime
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to  dis-/enable
listener at runtime
--------------------------+------------------------------------------------ -
  Reporter:  su           |       Owner:  romanb                  
      Type:  enhancement  |      Status:  new                      
  Priority:  minor        |   Milestone:  Unknown                  
 Component:  Record       |     Version:  1.0.3                    
Resolution:               |    Keywords:  record, listener, runtime
  Has_test:  0            |    Mystatus:  Pending Core Response    
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Comment (by jwage):

 Have you applied the patch and ran the test suite to see if it affects
 any?

 You can run them by doing the following:

 {{{
 svn co http://svn.doctrine-project.org/branches/1.0 doctrine
 cd doctrine/tests
 php run.php
 }}}

 Apply the patch and run the tests again to see if you have any new fails.

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1590#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 21 Oct 2008, 19:48
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Tue, 21 Oct 2008 18:48:53 -0000
Local: Tues 21 Oct 2008 19:48
Subject: Re: [Doctrine] #1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable listener at runtime
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to  dis-/enable
listener at runtime
--------------------------+------------------------------------------------ -
  Reporter:  su           |       Owner:  romanb                  
      Type:  enhancement  |      Status:  new                      
  Priority:  minor        |   Milestone:  1.2.0                    
 Component:  Record       |     Version:  1.0.3                    
Resolution:               |    Keywords:  record, listener, runtime
  Has_test:  0            |    Mystatus:  Pending Core Response    
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Changes (by jwage):

  * milestone:  Unknown => 1.2.0

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1590#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 21 Oct 2008, 20:30
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Tue, 21 Oct 2008 19:30:35 -0000
Local: Tues 21 Oct 2008 20:30
Subject: Re: [Doctrine] #1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable listener at runtime
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to  dis-/enable
listener at runtime
--------------------------+------------------------------------------------ -
  Reporter:  su           |       Owner:  romanb                  
      Type:  enhancement  |      Status:  new                      
  Priority:  minor        |   Milestone:  1.2.0                    
 Component:  Record       |     Version:  1.0.3                    
Resolution:               |    Keywords:  record, listener, runtime
  Has_test:  0            |    Mystatus:  Pending Core Response    
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Comment (by su):

 ok test results without my patch:
 {{{
 Tested: 305 test cases.
 Successes: 3575 passes.
 Failures: 14 fails.
 Number of new Failures: 0
 Number of fixed Failures: 0
 }}}

 test results with my patch applied:
 {{{
 Tested: 305 test cases.
 Successes: 3575 passes.
 Failures: 14 fails.
 Number of new Failures: 0
 Number of fixed Failures: 0
 }}}

 so it looks like nothing is affected..

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1590#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 2 Dec 2008, 14:30
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Tue, 02 Dec 2008 14:30:09 -0000
Local: Tues 2 Dec 2008 14:30
Subject: Re: [Doctrine] #1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable listener at runtime
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to  dis-/enable
listener at runtime
--------------------------+------------------------------------------------ -
  Reporter:  su           |       Owner:  romanb                  
      Type:  enhancement  |      Status:  closed                  
  Priority:  minor        |   Milestone:  1.2.0                    
 Component:  Record       |     Version:  1.0.3                    
Resolution:  fixed        |    Keywords:  record, listener, runtime
  Has_test:  0            |    Mystatus:  Pending Core Response    
 Has_patch:  1            |  
--------------------------+------------------------------------------------ -
Changes (by guilhermeblanco):

  * status:  new => closed
  * resolution:  => fixed

Old description:

New description:

 As discussed in the mailing-list, I attached a patch which adds a
 $_options class var + getter/setter method to the Doctrine_Record_Listener
 class, which would give us the opportunity to dis-/enable record listener
 at runtime.

 This solution is working if the Listener are checking their options array
 at the corresponding hooks like the bundled Timstampable listener and many
 others does.

 Example code to disable the timestampable (in this example the first
 attached listener) listener at runtime with the applied patch:
 {{{
 // get the first (in our case the timstampable) listener for the record
 $timestampable = $record->getListener()->get(0);

 // disable setting of created_at at the timestampable listener
 $timestampable->setOption(array('created' => array('disabled' => true)));
 }}}

--

Comment:

 In r5236 I commited an implementation to support this. Thanks for the
 patch, it inspired me a lot!

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1590#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.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google