public function onReadAtChanged($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        $raAttribute = $sender->readAtAttribute;
        if (!is_string($raAttribute) || empty($raAttribute)) {
            return;
        }
        $reaAttribute = $sender->receivedAtAttribute;
        if (is_string($reaAttribute) && !$sender->isInitDatetime($sender->$raAttribute) && $sender->isInitDatetime($sender->$reaAttribute)) {
            $sender->$reaAttribute = $sender->currentDatetime();
        }
        // If it is permitted to change read time, it will return directly.
        if ($sender->permitChangeReadAt) {
            return;
        }
        $oldRa = $sender->getOldAttribute($raAttribute);
        if ($oldRa != null && !$sender->isInitDatetime($oldRa) && $sender->$raAttribute != $oldRa) {
            $sender->$raAttribute = $oldRa;
        }
    }
public function onReadAtChanged($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        $raAttribute = $sender->readAtAttribute;
        if (!is_string($raAttribute) || empty($raAttribute)) {
            return;
        }
        $reaAttribute = $sender->receivedAtAttribute;
        if (is_string($reaAttribute) && !$sender->isInitDatetime($sender->$raAttribute) && $sender->isInitDatetime($sender->$reaAttribute)) {
            $sender->$reaAttribute = $sender->currentDatetime();
        }
        // If it is permitted to change read time, it will return directly.
        if ($sender->permitChangeReadAt) {
            return;
        }
        $oldRa = $sender->getOldAttribute($raAttribute);
        if ($oldRa != null && !$sender->isInitDatetime($oldRa) && $sender->$raAttribute != $oldRa) {
            $sender->$raAttribute = $oldRa;
        }
    }
public function onReadAtChanged ( $ event ) { $ sender = $ event -> sender ; /* @var $sender static */ $ raAttribute = $ sender -> readAtAttribute ; if ( ! is_string ( $ raAttribute ) || empty ( $ raAttribute ) ) { return ; } $ reaAttribute = $ sender -> receivedAtAttribute ; if ( is_string ( $ reaAttribute ) && ! $ sender -> isInitDatetime ( $ sender -> $ raAttribute ) && $ sender -> isInitDatetime ( $ sender -> $ reaAttribute ) ) { $ sender -> $ reaAttribute = $ sender -> currentDatetime ( ) ; } // If it is permitted to change read time, it will return directly. if ( $ sender -> permitChangeReadAt ) { return ; } $ oldRa = $ sender -> getOldAttribute ( $ raAttribute ) ; if ( $ oldRa != null && ! $ sender -> isInitDatetime ( $ oldRa ) && $ sender -> $ raAttribute != $ oldRa ) { $ sender -> $ raAttribute = $ oldRa ; } }
We consider you have received the message if you read it.
@param ModelEvent $event
We consider you have received the message if you read it .