protected function _actionGetgraph(AnCommandContext $context)
    {
        $this->getState()->insert('type', 'followers');

        $filters = array();
        $entities = array();
        $entity = $this->getItem();
        $viewer = get_viewer();

        if ($this->getItem()->isFollowable()) {
            if ($this->type == 'followers') {
                $entities = $this->getItem()->followers;
            } elseif ($this->type == 'blockeds' && $entity->authorize('administration')) {
                $entities = $this->getItem()->blockeds;
            } elseif ($this->type == 'leadables') {
                if (!$entity->authorize('leadable')) {
                    throw new LibBaseControllerExceptionForbidden('Forbidden');
                }

                $excludeIds = AnConfig::unbox($entity->followers->id);

                $excludeIds = array_merge($excludeIds, AnConfig::unbox($entity->blockeds->id));

                if ($viewer->admin()) {
                    $entities = $this->_mixer->getService('com:people.domain.entity.person')
                                ->getRepository()->getQuery()
                                ->where('person.id', 'NOT IN', $excludeIds);
                } else {
                    $entities = $viewer->followers->where('actor.id', 'NOT IN', $excludeIds);
                }
            }
        }

        if ($this->getItem()->isLeadable()) {
            if ($this->type == 'leaders') {
                $entities = $this->getItem()->leaders;
            } elseif ($this->type == 'mutuals') {
                $entities = $this->getItem()->getMutuals();
            } elseif ($this->type == 'commonleaders') {
                $entities = $this->getItem()->getCommonLeaders(get_viewer());
            }
        }

        if (!$entities) {
            return false;
        }

        $xid = (array) AnConfig::unbox($this->getState()->xid);

        if (!empty($xid)) {
            $entities->where('id', 'NOT IN', $xid);
        }

        $entities->limit($this->limit, $this->start);

        if ($this->q) {
            $entities->keyword($this->q);
        }

        $this->setList($entities->fetchSet())->actor($this->getItem());

        return $entities;
    }
protected function _actionGetgraph(AnCommandContext $context)
    {
        $this->getState()->insert('type', 'followers');

        $filters = array();
        $entities = array();
        $entity = $this->getItem();
        $viewer = get_viewer();

        if ($this->getItem()->isFollowable()) {
            if ($this->type == 'followers') {
                $entities = $this->getItem()->followers;
            } elseif ($this->type == 'blockeds' && $entity->authorize('administration')) {
                $entities = $this->getItem()->blockeds;
            } elseif ($this->type == 'leadables') {
                if (!$entity->authorize('leadable')) {
                    throw new LibBaseControllerExceptionForbidden('Forbidden');
                }

                $excludeIds = AnConfig::unbox($entity->followers->id);

                $excludeIds = array_merge($excludeIds, AnConfig::unbox($entity->blockeds->id));

                if ($viewer->admin()) {
                    $entities = $this->_mixer->getService('com:people.domain.entity.person')
                                ->getRepository()->getQuery()
                                ->where('person.id', 'NOT IN', $excludeIds);
                } else {
                    $entities = $viewer->followers->where('actor.id', 'NOT IN', $excludeIds);
                }
            }
        }

        if ($this->getItem()->isLeadable()) {
            if ($this->type == 'leaders') {
                $entities = $this->getItem()->leaders;
            } elseif ($this->type == 'mutuals') {
                $entities = $this->getItem()->getMutuals();
            } elseif ($this->type == 'commonleaders') {
                $entities = $this->getItem()->getCommonLeaders(get_viewer());
            }
        }

        if (!$entities) {
            return false;
        }

        $xid = (array) AnConfig::unbox($this->getState()->xid);

        if (!empty($xid)) {
            $entities->where('id', 'NOT IN', $xid);
        }

        $entities->limit($this->limit, $this->start);

        if ($this->q) {
            $entities->keyword($this->q);
        }

        $this->setList($entities->fetchSet())->actor($this->getItem());

        return $entities;
    }
protected function _actionGetgraph ( AnCommandContext $ context ) { $ this -> getState ( ) -> insert ( 'type' , 'followers' ) ; $ filters = array ( ) ; $ entities = array ( ) ; $ entity = $ this -> getItem ( ) ; $ viewer = get_viewer ( ) ; if ( $ this -> getItem ( ) -> isFollowable ( ) ) { if ( $ this -> type == 'followers' ) { $ entities = $ this -> getItem ( ) -> followers ; } elseif ( $ this -> type == 'blockeds' && $ entity -> authorize ( 'administration' ) ) { $ entities = $ this -> getItem ( ) -> blockeds ; } elseif ( $ this -> type == 'leadables' ) { if ( ! $ entity -> authorize ( 'leadable' ) ) { throw new LibBaseControllerExceptionForbidden ( 'Forbidden' ) ; } $ excludeIds = AnConfig :: unbox ( $ entity -> followers -> id ) ; $ excludeIds = array_merge ( $ excludeIds , AnConfig :: unbox ( $ entity -> blockeds -> id ) ) ; if ( $ viewer -> admin ( ) ) { $ entities = $ this -> _mixer -> getService ( 'com:people.domain.entity.person' ) -> getRepository ( ) -> getQuery ( ) -> where ( 'person.id' , 'NOT IN' , $ excludeIds ) ; } else { $ entities = $ viewer -> followers -> where ( 'actor.id' , 'NOT IN' , $ excludeIds ) ; } } } if ( $ this -> getItem ( ) -> isLeadable ( ) ) { if ( $ this -> type == 'leaders' ) { $ entities = $ this -> getItem ( ) -> leaders ; } elseif ( $ this -> type == 'mutuals' ) { $ entities = $ this -> getItem ( ) -> getMutuals ( ) ; } elseif ( $ this -> type == 'commonleaders' ) { $ entities = $ this -> getItem ( ) -> getCommonLeaders ( get_viewer ( ) ) ; } } if ( ! $ entities ) { return false ; } $ xid = ( array ) AnConfig :: unbox ( $ this -> getState ( ) -> xid ) ; if ( ! empty ( $ xid ) ) { $ entities -> where ( 'id' , 'NOT IN' , $ xid ) ; } $ entities -> limit ( $ this -> limit , $ this -> start ) ; if ( $ this -> q ) { $ entities -> keyword ( $ this -> q ) ; } $ this -> setList ( $ entities -> fetchSet ( ) ) -> actor ( $ this -> getItem ( ) ) ; return $ entities ; }
Read Owner's Socialgraph.

@param AnCommandContext $context

@return AnDomainEntitysetDefault
Read Owner s Socialgraph .