public function onReceivedAtChanged($event)
    {
        $sender = $event->sender;
        $raAttribute = $sender->receivedAtAttribute;
        if (!is_string($raAttribute) || empty($raAttribute)) {
            return;
        }
        // If it is permitted to change receiving time, then it will return directly.
        if ($sender->permitChangeReceivedAt) {
            return;
        }
        $oldRa = $sender->getOldAttribute($raAttribute);
        if ($oldRa != null && !$sender->isInitDatetime($oldRa) && $sender->$raAttribute != $oldRa) {
            $sender->$raAttribute = $oldRa;
        }
    }
public function onReceivedAtChanged($event)
    {
        $sender = $event->sender;
        $raAttribute = $sender->receivedAtAttribute;
        if (!is_string($raAttribute) || empty($raAttribute)) {
            return;
        }
        // If it is permitted to change receiving time, then it will return directly.
        if ($sender->permitChangeReceivedAt) {
            return;
        }
        $oldRa = $sender->getOldAttribute($raAttribute);
        if ($oldRa != null && !$sender->isInitDatetime($oldRa) && $sender->$raAttribute != $oldRa) {
            $sender->$raAttribute = $oldRa;
        }
    }
public function onReceivedAtChanged ( $ event ) { $ sender = $ event -> sender ; $ raAttribute = $ sender -> receivedAtAttribute ; if ( ! is_string ( $ raAttribute ) || empty ( $ raAttribute ) ) { return ; } // If it is permitted to change receiving time, then it will return directly. if ( $ sender -> permitChangeReceivedAt ) { return ; } $ oldRa = $ sender -> getOldAttribute ( $ raAttribute ) ; if ( $ oldRa != null && ! $ sender -> isInitDatetime ( $ oldRa ) && $ sender -> $ raAttribute != $ oldRa ) { $ sender -> $ raAttribute = $ oldRa ; } }
You are not allowed to change receiving time if you have received it.
@param ModelEvent $event
You are not allowed to change receiving time if you have received it .