PrajapatiRaj / yii-user

Automatically exported from code.google.com/p/yii-user
0 stars 0 forks source link

Behaviors are not overridable #115

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When configuring the module I can specify the User class's relations but not 
its behaviors. I have a situation where I'd like to use the withRelated 
behavior and so have had to modify the User class in the module to allow it 
with the following snippet:

    /**
     * @return array behaviors
     */
    public function behaviors() {        
        if (isset(Yii::app()->getModule('user')->behaviors))
            return Yii::app()->getModule('user')->behaviors;
        else
            return array();
    }

Original issue reported on code.google.com by allain.lalonde on 10 Nov 2011 at 7:50

GoogleCodeExporter commented 8 years ago
Serves me right, had the wrong thing in the clipboard

/**
     * @return array behaviors
     */
    public function behaviors() {        
        if (isset(Yii::app()->getModule('user')->userBehaviors))
            return Yii::app()->getModule('user')->userBehaviors;
        else
            return array();
    }

Original comment by allain.lalonde on 10 Nov 2011 at 8:04