public function removeNodeSubscriptions($leader, $follower)
    {
        //Find all the nodes that follower was subscribed to
        $query = $this->getService('repos:base.subscription')
                 ->getQuery()->subscriber($follower)
                 ->where('subscribee.id', 'IN', $this->getService('repos:base.node')
                 ->getQuery()->columns('id')->where('owner_id', '=', $leader->id));

        $subscribers = $query->disableChain()->fetchValues('subscribee.id');

        //Remove the follower as subscriber from any node that's owned by the leader
        if (count($subscribers)) {
            $this->getService('repos:base.node')
            ->update("subscriber_ids = @remove_from_set(subscriber_ids,{$follower->id}), subscriber_count = @set_length(subscriber_ids)", $subscribers);

            $this->getService('repos:base.subscription')->destroy($query);
        }
    }
public function removeNodeSubscriptions($leader, $follower)
    {
        //Find all the nodes that follower was subscribed to
        $query = $this->getService('repos:base.subscription')
                 ->getQuery()->subscriber($follower)
                 ->where('subscribee.id', 'IN', $this->getService('repos:base.node')
                 ->getQuery()->columns('id')->where('owner_id', '=', $leader->id));

        $subscribers = $query->disableChain()->fetchValues('subscribee.id');

        //Remove the follower as subscriber from any node that's owned by the leader
        if (count($subscribers)) {
            $this->getService('repos:base.node')
            ->update("subscriber_ids = @remove_from_set(subscriber_ids,{$follower->id}), subscriber_count = @set_length(subscriber_ids)", $subscribers);

            $this->getService('repos:base.subscription')->destroy($query);
        }
    }
public function removeNodeSubscriptions ( $ leader , $ follower ) { //Find all the nodes that follower was subscribed to $ query = $ this -> getService ( 'repos:base.subscription' ) -> getQuery ( ) -> subscriber ( $ follower ) -> where ( 'subscribee.id' , 'IN' , $ this -> getService ( 'repos:base.node' ) -> getQuery ( ) -> columns ( 'id' ) -> where ( 'owner_id' , '=' , $ leader -> id ) ) ; $ subscribers = $ query -> disableChain ( ) -> fetchValues ( 'subscribee.id' ) ; //Remove the follower as subscriber from any node that's owned by the leader if ( count ( $ subscribers ) ) { $ this -> getService ( 'repos:base.node' ) -> update ( "subscriber_ids = @remove_from_set(subscriber_ids,{$follower->id}), subscriber_count = @set_length(subscriber_ids)" , $ subscribers ) ; $ this -> getService ( 'repos:base.subscription' ) -> destroy ( $ query ) ; } }
Remove all the subscriptions of a follower to the nodes owned by a leader.

@param ComActorsDomainEntityActor $leader
@param ComActorsDomainEntityActor $follower
Remove all the subscriptions of a follower to the nodes owned by a leader .