protected function _beforeRepositoryFetch(AnCommandContext $context)
    {
        if (AnService::has('viewer')) {
            $query = $context->query;
            $repository = $query->getRepository();
            $viewer = get_viewer();

            if ($viewer->id) {
                $query->where("IF( FIND_IN_SET({$viewer->id}, @col(blockedIds)), 0, 1)");
            }
        }
    }
protected function _beforeRepositoryFetch(AnCommandContext $context)
    {
        if (AnService::has('viewer')) {
            $query = $context->query;
            $repository = $query->getRepository();
            $viewer = get_viewer();

            if ($viewer->id) {
                $query->where("IF( FIND_IN_SET({$viewer->id}, @col(blockedIds)), 0, 1)");
            }
        }
    }
protected function _beforeRepositoryFetch ( AnCommandContext $ context ) { if ( AnService :: has ( 'viewer' ) ) { $ query = $ context -> query ; $ repository = $ query -> getRepository ( ) ; $ viewer = get_viewer ( ) ; if ( $ viewer -> id ) { $ query -> where ( "IF( FIND_IN_SET({$viewer->id}, @col(blockedIds)), 0, 1)" ) ; } } }
Adds a filter to the query based on the access mode.

@param AnCommandContext $context
Adds a filter to the query based on the access mode .