CBehavior change _attachEventHandlers to protected #2665

Open
KJLJon opened this Issue Jul 19, 2013 · 0 comments

1 participant

@KJLJon

Hello I am wondering if we could change CBehavior::_attachEventHandlers to a protected method instead of private.

Use case:
Nesting behaviors.

Example:
DateConversionBehavior
EncryptionBehavior

I receive a date that convert into a standard way for the db to store it
and with the encryption behavior it encrypts it.

Well when it returns the date it has to decrypt it first and convert it second to how the user wants their date displayed.

Problem:
Behaviors get attached in the way they are put in and it doesn't allow for this.

Solution:
if it is a protected method I can create my own Behavior class to make exceptions for different events to change the order it inserts it into the event handler (append for some events and prepend for others).

@KJLJon KJLJon added a commit to KJLJon/yii that referenced this issue Aug 23, 2013
@KJLJon KJLJon Chg #2665: CBehavior change _attachEventHandlers to protected
updating changelog
35e78c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment