Google Groups Home
Help | Sign in
#1208: ability to define record level handlers for custom fields
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
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
Doctrine  
View profile
 More options 3 Jul, 19:25
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Thu, 03 Jul 2008 18:25:48 -0000
Local: Thurs 3 Jul 2008 19:25
Subject: [Doctrine] #1208: ability to define record level handlers for custom fields
#1208: ability to define record level handlers for custom fields
-----------------------------------+--------------------------------------- -
 Reporter:  ccunningham            |       Owner:  romanb
     Type:  defect                 |      Status:  new  
 Priority:  minor                  |   Milestone:        
Component:  Listeners              |     Version:  0.11  
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+--------------------------------------- -
 It would be nice if you could put the equivalent of a preHydrate handler
 in your record class to add custom/calculated fields to your model. The
 current method requires a HydrateListener which works, but requires you to
 either have one for each type of custom field you want, or just one that
 has to do some introspection and switches to handle different things. If
 you have a dozen models each of which may need their own set of custom
 fields, this becomes a real pain. If you could just throw it in the record
 class like:

 public function preHydrate( $event )
 {

   if ( $this->due_date < ... )
   {
     $this->status = 'current';
   }
   else
   {
     $this->status = 'expired';
   }
 }

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1208>
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
 More options 19 Jul, 17:52
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Sat, 19 Jul 2008 16:52:29 -0000
Local: Sat 19 Jul 2008 17:52
Subject: Re: [Doctrine] #1208: ability to define record level handlers for custom fields
#1208: ability to define record level handlers for custom fields
--------------------------+------------------------------------------------ -
  Reporter:  ccunningham  |       Owner:  romanb              
      Type:  defect       |      Status:  closed              
  Priority:  minor        |   Milestone:                      
 Component:  Listeners    |     Version:  0.11                
Resolution:  invalid      |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  0            |  
--------------------------+------------------------------------------------ -
Changes (by guilhermeblanco):

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

Comment:

 You can do it through postHydrate listener and access the element through
 $event->data.

 Marking the ticket as invalid. If it's not the case, reopen the ticket
 with a test case of expected behavior.

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


    Reply    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
 More options 19 Jul, 17:53
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Sat, 19 Jul 2008 16:53:59 -0000
Local: Sat 19 Jul 2008 17:53
Subject: Re: [Doctrine] #1208: ability to define record level handlers for custom fields
#1208: ability to define record level handlers for custom fields
--------------------------+------------------------------------------------ -
  Reporter:  ccunningham  |       Owner:  romanb              
      Type:  defect       |      Status:  closed              
  Priority:  minor        |   Milestone:  1.0.0-BETA1          
 Component:  Listeners    |     Version:  0.11                
Resolution:  invalid      |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  0            |  
--------------------------+------------------------------------------------ -
Changes (by romanb):

  * milestone:  => 1.0.0-BETA1

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


    Reply    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
 More options 4 Aug, 19:24
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Mon, 04 Aug 2008 18:24:49 -0000
Local: Mon 4 Aug 2008 19:24
Subject: Re: [Doctrine] #1208: ability to define record level handlers for custom fields
#1208: ability to define record level handlers for custom fields
--------------------------+------------------------------------------------ -
  Reporter:  ccunningham  |       Owner:  romanb              
      Type:  defect       |      Status:  reopened            
  Priority:  minor        |   Milestone:  1.0.0-BETA1          
 Component:  Listeners    |     Version:  0.11                
Resolution:               |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  0            |  
--------------------------+------------------------------------------------ -
Changes (by ccunningham):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 Yes, it can be done, however it's a real pain.

 I have a number of classes I want to do this on. I have a few entity
 classes representing people, I have some other classes which need a piece
 of data for 'name' where it's based on whether a custom name has been
 chosen, etc. It can be done through the listener interface, however that
 would involve having one listener class with a big switch statement ( to
 perform the desired custom field for each model type ) or create a bunch
 of different listener classes and assign them on a per table basis.
 Essentially I either have one big ugly global listener that isn't needed
 on all objects, or a bunch of small simple ones I have to attach on each
 model type.

 While that does do what I want, it isn't convenient or simple...

 Why can't I just put a postHydrate() function in each model class and do
 what I want there? It would greatly simplify the process and let you keep
 these little snippets nicely nested in their own models, so instead of
 having all these listener classes laying around I have a nice clean model.

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


    Reply    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
 More options 27 Aug, 22:33
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Wed, 27 Aug 2008 21:33:42 -0000
Local: Wed 27 Aug 2008 22:33
Subject: Re: [Doctrine] #1208: ability to define record level handlers for custom fields
#1208: ability to define record level handlers for custom fields
--------------------------+------------------------------------------------ -
  Reporter:  ccunningham  |       Owner:  romanb              
      Type:  defect       |      Status:  reopened            
  Priority:  minor        |   Milestone:  1.1.0                
 Component:  Listeners    |     Version:  1.0                  
Resolution:               |    Keywords:                      
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  0            |  
--------------------------+------------------------------------------------ -
Changes (by jwage):

  * version:  0.11 => 1.0
  * milestone:  Unknown => 1.1.0

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


    Reply    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
©2008 Google