public function onDeleteRelation($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if ($sender->relationType == static::$relationMutual) {
            $sender->off(static::EVENT_AFTER_DELETE, [$sender, 'onDeleteRelation']);
            static::removeAllRelations($sender->recipient, $sender->initiator);
            $sender->on(static::EVENT_AFTER_DELETE, [$sender, 'onDeleteRelation']);
        }
    }
public function onDeleteRelation($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if ($sender->relationType == static::$relationMutual) {
            $sender->off(static::EVENT_AFTER_DELETE, [$sender, 'onDeleteRelation']);
            static::removeAllRelations($sender->recipient, $sender->initiator);
            $sender->on(static::EVENT_AFTER_DELETE, [$sender, 'onDeleteRelation']);
        }
    }
public function onDeleteRelation ( $ event ) { $ sender = $ event -> sender ; /* @var $sender static */ if ( $ sender -> relationType == static :: $ relationMutual ) { $ sender -> off ( static :: EVENT_AFTER_DELETE , [ $ sender , 'onDeleteRelation' ] ) ; static :: removeAllRelations ( $ sender -> recipient , $ sender -> initiator ) ; $ sender -> on ( static :: EVENT_AFTER_DELETE , [ $ sender , 'onDeleteRelation' ] ) ; } }
The event triggered after delete relation.
The opposite relation should be deleted without triggering events
simultaneously after existed relation removed.
@param ModelEvent $event
The event triggered after delete relation . The opposite relation should be deleted without triggering events simultaneously after existed relation removed .