| |
doctrine-svn |
#1590: [PATCH] Doctrine_Record_Listener options getter/setter to dis-/enable
This solution is working if the Listener are checking their options array
Example code to disable the timestampable (in this example the first
// disable setting of created_at at the timestampable listener
--
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.
at the corresponding hooks like the bundled Timstampable listener and many
others does.
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);
$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