Add a set of actors to the owners list of requester.

@param AnCommandContext $context Context Parameter
541179
protected function _actionDeleterequest(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->removeRequester($this->actor);
    }
18739
protected function _actionAddapp(AnCommandContext $context)
    {
        $data = $context->data;
        $this->getItem()->components->insert($data->app);
        $this->commit();
    }
998636
protected function _afterEntityInsert(AnCommandContext $context)
    {
        $this->votee->getRepository()
                    ->getBehavior('votable')
                    ->resetStats(array($this->votee));
    }
1354040
protected function _actionAddrequest(AnCommandContext $context)
    {
        if ($this->getItem()->eql($this->actor)) {
            throw new LibBaseControllerExceptionForbidden('Forbidden');
        }

        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->addRequester($this->actor);
        $this->createNotification(array(
            'subject' => $this->actor,
            'target' => $this->getItem(),
            'name' => 'actor_request',
          ));

        return $this->getItem();
    }
229612
protected function _actionEdit(AnCommandContext $context)
    {
        $entity = parent::_actionEdit($context);

        if ($entity->isPortraitable() && AnRequest::has('files.portrait')) {
            $file = AnRequest::get('files.portrait', 'raw');

            if ($this->bellowSizeLimit($file) && $file['error'] == 0) {
                $this->getItem()->setPortrait(array(
                    'url' => $file['tmp_name'],
                    'mimetype' => $file['type']
                ));
            } else {
                $this->getItem()->removePortraitImage();
            }
        }

        if ($entity->save($context)) {
            dispatch_plugin('profile.onSave', array(
                'actor' => $entity,
                'data' => $context->data,
                ));
        }

        return $entity;
    }
21493
protected function _actionEdit(AnCommandContext $context)
    {
        $context->response->status = AnHttpResponse::RESET_CONTENT;

        return $this->getItem()->setData($context['data']);
    }
323463
protected function _actionAdd(AnCommandContext $context)
    {
        $context->response->status = AnHttpResponse::CREATED;
        $entity = $this->getRepository()->getEntity()->setData($context['data']);
        $this->setItem($entity);

        return $this->getItem();
    }
1090253
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;
    }
1287399
protected function _authorizeMention(AnCommandContext $context)
    {
        if (
            $this->_entity->blocking($this->_viewer) ||
            $this->_viewer->blocking($this->_entity)
            ) {
            return false;
        }

        return true;
    }
1176712
protected function _actionBrowse(AnCommandContext $context)
    {
        if (! $context->query) {
            $context->query = $this->getRepository()->getQuery();
        }

        $query = $context->query;

        if ($this->filter) {
            if ($this->filter['usertype'] && in_array($this->filter['usertype'], $this->_allowed_user_types)) {
                $query->filterUsertype($this->getService('anahita:filter.cmd')
                      ->sanitize($this->filter['usertype']));
            }

            if ($this->filter['disabled']) {
                $query->filterDisabledAccounts(true);
            }
        }

        if ($this->getService('anahita:filter.email')->validate($this->q)) {
            $query->filterEmail($this->q);
        }

        if ($this->getService('com:people.filter.username')->validate($this->q)) {
            $query->filterUsername($this->q);
        }

        if ($this->q) {
            $query->keyword = $this->getService('anahita:filter.term')->sanitize($this->q);
        }

        if ($this->ids) {
            $ids = AnConfig::unbox($this->ids);
            $query->id($ids);
        } else {
            $query->limit($this->limit, $this->start);
        }

        $entities = $this->getState()->setList($query->toEntityset())->getList();

        return $entities;
    }
1334462
protected function _actionUnlead(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->removeLeader($this->actor);

        return $this->getItem();
    }
24200
protected function _afterControllerAdd(AnCommandContext $context)
    {
        $data = $context->data;

        if ($data->composed && $data->story) {
            if ($context->response->isRedirect()) {
                $context->response->setStatus(AnHttpResponse::OK);
                $context->response->removeHeader('Location');
            }

            $content = $this->_renderComposedStory($data->story);
            $context->response->setContent($content);
        }
    }
191092
protected function _actionPost(AnCommandContext $context)
    {
        $data = $context->data;

        $viewer = get_viewer();

        $setting = $this->getService('repos:notifications.setting')->findOrAddNew(array(
            'person' => $viewer,
            'actor' => $this->actor,
        ));

        $setting->setValue('posts', null, $data->email);

        $setting->save();
    }
453705
protected function _actionBrowse(AnCommandContext $context)
    {
        $entities = parent::_actionBrowse($context);

        if (
            $this->getRepository()->hasBehavior('ownable') &&
            $this->filter == 'leaders'
        ) {
            $leaderIds = array($this->viewer->id);
            $leaderIds = array_merge($leaderIds, $this->viewer->getLeaderIds()->toArray());
            $entities->where('owner.id', 'IN', $leaderIds);
        } elseif (
            $this->getRepository()->hasBehavior('ownable') &&
            $this->actor && $this->actor->id > 0
        ) {
            $entities->where('owner', '=', $this->actor);
        }

        return $entities;
    }
72644
protected function _actionOptions(AnCommandContext $context)
    {
        $context->response->status = AnHttpResponse::OK;
        $context->response->set('Content-Length', 0);
    }
150746
public function setContext(RequestContext $context)
    {
        foreach ($this->matchers as $matcher) {
            $matcher->setContext($context);
        }

        $this->context = $context;
    }
1068216
protected function _actionAdd(AnCommandContext  $context)
     {
         $data = $context->data;

         dispatch_plugin('user.onBeforeAddPerson', array('data' => $context->data));

         $person = parent::_actionAdd($context);

         $this->getRepository()
         ->getValidator()
         ->addValidation('givenName', 'required')
         ->addValidation('familyName', 'required')
         ->addValidation('usertype', 'required')
         ->addValidation('username', 'uniqueness')
         ->addValidation('email', 'uniqueness');

         if ($person->validate() === false) {
             throw new AnErrorException($person->getErrors(), AnHttpResponse::BAD_REQUEST);
         }

         $viewer = get_viewer();

         if (in_array($data->usertype, $this->_allowed_user_types)) {
             $person->usertype = $data->usertype;
         } else {
             $person->usertype = ComPeopleDomainEntityPerson::USERTYPE_REGISTERED;
         }

         dispatch_plugin('user.onAfterAddPerson', array('person' => $person));

         if ($person->admin()) {
             $this->registerCallback('after.add', array($this, 'mailAdminsNewAdmin'));
         }
         
         $context->response->setRedirect(route('option=com_people&view=people'));
         
         return $person;
     }