Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix getReceiverName getSenderName methods

  • Loading branch information...
commit 882d5c674b5ec5b630182a099e085452abf49c86 1 parent 13262d8
Alex Hudenko authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 models/Message.php
View
8 models/Message.php
@@ -138,11 +138,15 @@ public function search()
}
public function getSenderName() {
- return call_user_func(array($this->sender, Yii::app()->getModule('message')->getNameMethod));
+ if ($this->sender) {
+ return call_user_func(array($this->sender, Yii::app()->getModule('message')->getNameMethod));
+ }
}
public function getReceiverName() {
- return call_user_func(array($this->receiver, Yii::app()->getModule('message')->getNameMethod));
+ if ($this->receiver) {
+ return call_user_func(array($this->receiver, Yii::app()->getModule('message')->getNameMethod));
+ }
}
public static function getAdapterForInbox($userId) {

3 comments on commit 882d5c6

@zettabyte84

Hi friend,
I am new to yii.
I need to know something. Why I get this error -> "Method User::getFullName not defined"?
Where should I define?
Please help me. I am really need help.
Thanks.

(zettabyte84@gmail.com)

@weavora

Hi,

Thanks for following us and sorry for delayed response.

To solve the problem you should implement getFullName method into User model. For example:

class User extends CActiveRecord {
    ...
    public function getFullName() {
        return $this->first_name . ' ' . $this->last_name;
    }
    ...
}

Best regards,
Weavora Team
http://weavora.com

@zettabyte84
Please sign in to comment.
Something went wrong with that request. Please try again.