I’m trying to attach few events to my model object, but it is throwing an error.
$newAppt = new \app\models\ApptSchedule;
$newAppt->on = [self::EVENT_APPT_CREATED,'\backend\controllers\NotifyController', 'textCaller'];
$newAppt->on = [self::EVENT_APPT_CREATED,'\backend\controllers\NotifyController', 'notifyAdmins'];
$newAppt->on = [self::EVENT_APPT_CREATED,'\backend\controllers\NotifyController', 'NotifyDoctor'];
I noticed that ActiveRecord Model is extended from yii\base\Component so ‘on’ property should be available for model object. Am I missing anything obvious? Please help.