Complete

PUT /milestones/#{id}/complete.xml

Marks the specified milestone as complete. Returns Status 200 OK.

@param int $id

@return bool
@throws \TeamWorkPm\Exception
346968
public function complete($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->put("$this->action/$id/complete");
    }
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;
    }
264519
public function getActivityUploadStatus($id)
    {
        try {
            return $this->service->getActivityUploadStatus($id);
        } catch (ServiceException $e) {
            throw new ClientException('[SERVICE] ' . $e->getMessage());
        }
    }
1118290
public function apiUpdate(string $id)
    {
        DB::beginTransaction();

        try {
            $record = $this->__apiUpdate($id);
        } catch (\Exception $e) {
            DB::rollback();

            return HCLog::error('CORE-0003' . $e->getCode(), $e->getMessage());
        }

        DB::commit();

        return $record;
    }
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;
    }
654327
public function update($id)
    {
        try {
            $entry = $this->collection->findOne($id);
        } catch (Exception $e) {
            // noop
        }

        if (is_null($entry)) {
            return $this->app->notFound();
        }

        if ($this->request->isPost() || $this->request->isPut()) {
            try {
                $merged = array_merge(
                    isset($entry) ? $entry->dump() : array(),
                    $this->request->getBody() ?: array()
                );

                $entry->set($merged)->save();

                h('notification.info', $this->clazz.' updated');

                h('controller.update.success', array(
                    'model' => $entry,
                ));
            } catch (Stop $e) {
                throw $e;
            } catch (Exception $e) {
                h('notification.error', $e);

                if (empty($entry)) {
                    $model = null;
                }

                h('controller.update.error', array(
                    'error' => $e,
                    'model' => $entry,
                ));
            }
        }

        $this->data['entry'] = $entry;
    }
807699
public function toSimpleWorkflow($id)
	{
		if ($id === null) {
			$id = self::VALUE_NULL;
		}
		$statusId = array_search($id, $this->_map);
		if ($statusId === false) {
			throw new Exception('Conversion to SimpleWorkflow failed : no value found for id = '.$id);
		}
		return ($statusId == self::VALUE_NULL ? null : $statusId);
	}
847882
public function getStatus($id)
    {
        if ($this->isSuccess()) {
            foreach ($this->getResult() as $row) {
                if ($row['id'] == $id) {
                    return $row['status'];
                }
            }
        }

        return false;
    }
172540
public function complete($id)
    {
        if ($this->permToClose($id) == 'yes') {
            $ticket = $this->tickets->findOrFail($id);
            $ticket->completed_at = Carbon::now();

            if (Setting::grab('default_close_status_id')) {
                $ticket->status_id = Setting::grab('default_close_status_id');
            }

            $subject = $ticket->subject;
            $ticket->save();

            session()->flash('status', trans('ticketit::lang.the-ticket-has-been-completed', ['name' => $subject]));

            return redirect()->route(Setting::grab('main_route').'.index');
        }

        return redirect()->route(Setting::grab('main_route').'.index')
            ->with('warning', trans('ticketit::lang.you-are-not-permitted-to-do-this'));
    }
311412
public function flushTraceId($id)
    {
        if (_CLI_) {
            if (isset($this->_traceId[$id])) {
                unset($this->_traceId[$id]);
            }
        }
    }
301705
protected function checkFileUploadWithSessionGuard($id)
    {
        $guard = $this->getFileUploadSesssionGuard();

        return ! $guard->enabled() || $guard->check($id);
    }
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);
    }
490205
public function contains( $id ) {

		foreach ( $this->caches as $cache ) {
			if ( $cache->contains( $id ) ) {
				return true;
			}
		}

		return false;
	}
1166597
public function hasNextChild(int $id)
    {
        $child= $this->getChild($id);
        return $this->children[$child->id()]['next'];
    }
320765
public function archive($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        $data = [];
        $data['id'] = $id;
        $data['status'] = 'archived';
        return $this->update($data);
    }
132021
public function contain(string $id): bool
    {
        if ($this->properties()->containSection($id)) {
            return true;
        }

        return $this->hasFallback();
    }
1210143
public function update($id)
    {
        $content = $this->repository->getById($id);
        if (!empty($content)) {
            $this->authorize('update', $content);
            $input   = $this->validator->validate('update');
            $content = $this->repository->update($content, $input, auth()->user());
            return $this->respondWithSuccess($content, new ContentTransformer);
        }
        return $this->respondNotFound();
    }