Add team repository

@link https://developer.github.com/v3/orgs/teams/#add-team-repo

@param int $id

@return bool|array
@throws \Exception
421463
public function addTeamRepository(int $id)
    {
        $return = $this->getApi()->request($this->getApi()->sprintf('/teams/:id/repos/:org/:repo', (string)$id,
            $this->getOrganizations()->getOwner(), $this->getOrganizations()->getRepo()), Request::METHOD_PUT);

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return $return;
    }
663774
public function add(string $id): self
    {
        if (!isset($this->data[$id])) {
            $registeredAddon = \BearFramework\Addons::get($id);
            if ($registeredAddon === null) {
                throw new \Exception('The addon ' . $id . ' is not registered!');
            }
            $registeredAddonOptions = $registeredAddon->options;
            if (isset($registeredAddonOptions['require']) && is_array($registeredAddonOptions['require'])) {
                foreach ($registeredAddonOptions['require'] as $requiredAddonID) {
                    if (is_string($requiredAddonID) && !isset($this->data[$requiredAddonID])) {
                        $this->add($requiredAddonID);
                    }
                }
            }

            $dir = $registeredAddon->dir;
            $this->data[$id] = new \BearFramework\App\Addon($id, $dir);
            $this->app->contexts->add($dir);
        }
        return $this;
    }
278668
public function addCommentAction($id, Request $request = null)
    {
        $action = $this->container->get(CreateCommentAction::class);

        return $action($this->resolveRequest($request), $id);
    }
238796
public function addAction(Request $request, $id) 
    {
        $em = $this->getDoctrine()->getManager();
        $actor = $em->getRepository($this->get('core_manager')->getActorBundleName().':Actor')->findOneById($id);
        
        $trans = $this->get('translator');
        $form = $this->container->get('form.factory')->create('CoreBundle\Form\ActorRoleType');
        $form->handleRequest($request);
           
        if ($form->isSubmitted()) {
            $em = $this->getDoctrine()->getManager();
            $data = $request->request->get($form->getName());
            $role = $em->getRepository('CoreBundle:Role')->find($data['roles']);
            $actor->addRole($role);
            try {
                $em->persist($actor);
                $em->flush($actor);
                return new JsonResponse(array('status' => 'success', 'id'=> $actor->getId(), 'message'=> $trans->trans('role.created')));
            } catch (\Exception $exc) {
                return new JsonResponse(array('status' => 'error', 'message'=> $trans->trans('role.duplicate')));
            }
        }
        return new JsonResponse(array('status' => 'error', 'message'=> $trans->trans('role.form.notsubmit')));
    }
665632
public function update($id)
    {
        $parameters = $this->validateRequest(true);
        $model = $this->repository->update($id, $parameters);
        return $this->modelResponse($model);
    }
653314
public function add($id, array $tags)
    {
        $this->connection()->pipeline(function ($pipe) use ($id, $tags) {
            foreach ($tags as $tag) {
                $pipe->zadd($tag, $id, $id);
            }
        });
    }
113915
public function findById($id)
    {
        $id = $this->getRepository()->idToMongo($id);
        return $this->mergeCriteria(array('_id' => $id));
    }
687955
public function add($username, $repository, $collaborator, array $params = [])
    {
        return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator), $params);
    }
224279
public function isTeamAdmin($id)
    {
        $team = $this->teams->find($id);

        if ($team) {
            return (int) $team->user_id === (int) $this->id;
        }

        return false;
    }
978086
public function deleteRelease(string $id): bool
    {
        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return false;
    }
772622
public function store($id)
    {
        $this->repo->createOrUpdate(
            $id,
            $this->instanceName,
            json_encode(serialize([
                'content' => $this->content,
                'coupons' => $this->coupons,
            ]))
        );

        return $this;
    }
55494
public function listTeamMembers(int $id): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/teams/:id/members', (string)$id));
    }
1321319
public function getGuild4Id($id)
    {
        /** @var \GameBackend\Entity\SRO\Shard\Repository\Guild $repository */
        $repository = $this->getShardEntityManager()->getRepository($this->getGameOptions()->getEntityShardGuild());
        return $repository->getGuild4Id($id, $this->getGeneralOptions()->getGuildBlackList());
    }
1097721
public function activate($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        $data = [];
        $data['id'] = $id;
        $data['status'] = 'active';
        return $this->update($data);
    }
594812
public function checkTeamManagesRepository(int $id): bool
    {
        $this->getApi()->request($this->getApi()->sprintf('/teams/:id/repos/:owner/:repo', (string)$id,
            $this->getOrganizations()->getOwner(), $this->getOrganizations()->getRepo()));

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return false;
    }
269666
public function update($id, UpdateUploadRequest $request)
    {
        $upload = $this->repository->find($id);

        if (empty($upload)) {
            return $this->sendError('Upload not found');
        }
        $all = $request->all();

        $upload = $this->repository->update($all, $id);
        $upload->load($request->getWith());

        return $this->sendResponse($upload, 'Upload updated successfully.');
    }
160392
public function updateMappingTeam(int $teamId): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/teams/:team_id/mapping', (string)$teamId),
            Request::METHOD_PATCH);
    }