#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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---