public function onContentChanged($event)
    {
        $sender = $event->sender;
        // If it is permitted to change content, then it will return directly.
        if ($sender->permitChangeContent) {
            return;
        }
        // The messgage will be reversed if it changed (current message isn't
        // same as the old).
        $cAttribute = $sender->contentAttribute;
        $oldContent = $sender->getOldAttribute($cAttribute);
        if ($oldContent != $sender->$cAttribute) {
            $sender->$cAttribute = $oldContent;
        }
    }
public function onContentChanged($event)
    {
        $sender = $event->sender;
        // If it is permitted to change content, then it will return directly.
        if ($sender->permitChangeContent) {
            return;
        }
        // The messgage will be reversed if it changed (current message isn't
        // same as the old).
        $cAttribute = $sender->contentAttribute;
        $oldContent = $sender->getOldAttribute($cAttribute);
        if ($oldContent != $sender->$cAttribute) {
            $sender->$cAttribute = $oldContent;
        }
    }
public function onContentChanged ( $ event ) { $ sender = $ event -> sender ; // If it is permitted to change content, then it will return directly. if ( $ sender -> permitChangeContent ) { return ; } // The messgage will be reversed if it changed (current message isn't // same as the old). $ cAttribute = $ sender -> contentAttribute ; $ oldContent = $ sender -> getOldAttribute ( $ cAttribute ) ; if ( $ oldContent != $ sender -> $ cAttribute ) { $ sender -> $ cAttribute = $ oldContent ; } }
You are not allowed to change the content if it is not new message.
@param ModelEvent $event
You are not allowed to change the content if it is not new message .