I have a model called “Ticket”. Within the Ticket model in the “beforeSave” I have a function call. I’ll just give you the code
public function beforeSave() {
...
// this here is working
Notification::sendToClient(Ticket::model()->findByPk($this->id));
// and this here is not
Notification::sendToClient($this);
fun sendToClient($model) {
die($model->client->id);
}
// the id is different and i don't understand why
I can give you more details about what exactly is going wrong but this might be something trivial so i’ll just keep the stuff that’s not interesting to anyone to myself.