public function isMessageReceiver($userId)
    {
        if ($this->messageReceivers) {
            foreach ($this->messageReceivers as $receiver) {
                if ($receiver->receiver_id == $userId) {
                    return true;
                }
            }
        }
        return false;
    }
public function isMessageReceiver($userId)
    {
        if ($this->messageReceivers) {
            foreach ($this->messageReceivers as $receiver) {
                if ($receiver->receiver_id == $userId) {
                    return true;
                }
            }
        }
        return false;
    }
public function isMessageReceiver ( $ userId ) { if ( $ this -> messageReceivers ) { foreach ( $ this -> messageReceivers as $ receiver ) { if ( $ receiver -> receiver_id == $ userId ) { return true ; } } } return false ; }
Checks if user is a message receiver.
@param int $userId
@return bool
Checks if user is a message receiver .