public function onGetCurrentUserGuid($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if (isset($sender->attributes[$sender->createdByAttribute])) {
            return $sender->attributes[$sender->createdByAttribute];
        }
        $identity = \Yii::$app->user->identity;
        /* @var $identity BaseUserModel */
        if ($identity) {
            return $identity->getGUID();
        }
    }
public function onGetCurrentUserGuid($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if (isset($sender->attributes[$sender->createdByAttribute])) {
            return $sender->attributes[$sender->createdByAttribute];
        }
        $identity = \Yii::$app->user->identity;
        /* @var $identity BaseUserModel */
        if ($identity) {
            return $identity->getGUID();
        }
    }
public function onGetCurrentUserGuid ( $ event ) { $ sender = $ event -> sender ; /* @var $sender static */ if ( isset ( $ sender -> attributes [ $ sender -> createdByAttribute ] ) ) { return $ sender -> attributes [ $ sender -> createdByAttribute ] ; } $ identity = \ Yii :: $ app -> user -> identity ; /* @var $identity BaseUserModel */ if ( $ identity ) { return $ identity -> getGUID ( ) ; } }
Return the current user's GUID if current model doesn't specify the owner
yet, or return the owner's GUID if current model has been specified.
This method is ONLY used for being triggered by event. DO NOT call,
override or modify it directly, unless you know the consequences.
@param ModelEvent $event
@return string the GUID of current user or the owner.
Return the current user s GUID if current model doesn t specify the owner yet or return the owner s GUID if current model has been specified . This method is ONLY used for being triggered by event . DO NOT call override or modify it directly unless you know the consequences .