Uncomplete

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

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

@param int $id

@return bool
@throws \TeamWorkPm\Exception
341431
public function uncomplete($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->put("$this->action/$id/uncomplete");
    }
1157201
public function markEmailAsSent($id) {

        $emailMessage = $this->model->find($id);

        $emailMessage->sent = 1;

        return $emailMessage->save();
    }
800595
public function update($id)
    {
        $request = $this->makeRequest('update');
        $model = $this->service->update($request, $id);

        if(is_a($model, \Exception::class)) {

            return $this->getErrorResource($model);

        } else {

            return $this->maybeMakeResource('single', $model, 201);
        }
    }
722671
protected function iblockLocate($id)
    {
        if (empty($id)) {
            throw new Exception('Id parameter must not be empty');
        } elseif (!is_numeric($id)) {
            $findByCode = $this->iblockGetIdByCode($id);
            if ($findByCode === null) {
                throw new Exception("Can't find iblock by code: {$id}");
            }
            $id = $findByCode;
        }

        $iblock = $this->iblockGetById($id);
        if ($iblock === null) {
            throw new Exception("Can't find iblock by id: {$id}");
        }

        return $iblock;
    }
1069513
public function hasTagById( $id )
	{
		$xpath	= new DomXPath( $this->document );
		$query	= "//*[@id = '$id']";
		$nodes	= $xpath->query( $query );
		return (bool) $nodes->length;
	}
970983
public function deleteDestroy($id) {
    // Delete children if any exist
    Term::whereParent($id)->delete();

    // Delete Term
    Term::destroy($id);

    return Response::make('OK', 200);
  }
379980
public function clear(int $id)
    {
        unset($this->updates[$id]);
        $this->cache->remove($id);
    }
451088
public function delete($id)
	{
		$this->getResponse()
			->setStatusCode(Response::STATUS_CODE_200);
		
		$request = $this->getRequest();
		$content = $request->getContent();
		$content = !empty($content) ? Json::decode($content, Json::TYPE_ARRAY) : array();
		$post = array_merge_recursive(
			$request->getPost()->toArray(),
			$content
		);
		$classifiedService = $this->getServiceLocator()->get('document.service.classified');

		$returnData = '';
		$action = strtolower($id);
		$classifiedService = $this->getServiceLocator()->get('document.service.classified');
		
		switch($action) {
			case 'bulk':
				$ids = $this->params()->fromQuery('ids', array());
				$ids = !is_array($ids) ? explode(",", $ids) : $ids;
				$success = 0;
				$error = 0;
				foreach($ids as $id) {
					try {
						$classifiedService->delete($id);		
						$success++;
					} catch(\Exception $e) {
						$error++;
					};
				}
						
				$returnData = array(
					'status' => 'success',
					'message' => 'Annunci eliminati con successo (' . $success . '/' . $error . ')'
				);
				break;
			default:
				try {
					$classifiedService->delete($id);
					$returnData = array(
						'status' => 'success',
						'message' => 'Annuncio eliminato con successo'
					);
				} catch(\Exception $e) {
					$this->getResponse()
					->setStatusCode(Response::STATUS_CODE_500);
					$returnData = array(
						'status' => 'danger',
						'message' => $e->getMessage()
					);
				}
				break;
		}

		return new JsonModel($returnData);
	}
651578
public function remove($id)
    {
        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('c._uid = :uid')
                    ->setParameters(array('uid' => $this->getContextualId($id)))
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to remove cache for id %s : %s', $id, $e->getMessage()));

            return false;
        }

        return true;
    }
311412
public function flushTraceId($id)
    {
        if (_CLI_) {
            if (isset($this->_traceId[$id])) {
                unset($this->_traceId[$id]);
            }
        }
    }
145128
public function remove($id) {
		// Format id
		$id = $this->_format($id);
		// Verify existence
		if(!$this->has($id)) {
			throw new NotFoundException("'$id' value does not exist");
		}
		// Remove value
		unset($this->values[$id]);
	}
239775
public function delete(string $id): bool
    {
        if (\array_key_exists($id, $this->cache)) {

            //delete value
            unset($this->cache[$id]);

            //return function result
            return true;
        }

        return false;
    }
527769
public static function markResolved($id) {
		$db = Factory::getDBO();

		$query = $db->getQuery(true)
			->update('#__jfusion_sync_details')
			->set('action = ' . $db->quote('resolved'))
			->where('id = ' . $db->quote($id));

		$db->setQuery($query);
		$db->execute();
	}
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);
    }
104040
public function lock($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->put("$this->action/$id/lock");
    }
362784
public function actionSend($id)
    {
        $message = Message::findOne($id);
        if ($message !== null) {
            try {
                $message->status = $this->send($message) > 0 ? Message::STATUS_SUCCESS : Message::STATUS_ERROR;
                $message->save(true, ['status']);
            } catch (\Exception $e) {
                $message->status = Message::STATUS_ERROR;
                $message->save(true, ['status']);
                $this->stderr($e->getMessage());
            }
        } else {
            $this->stdout("Message not found\n");
            exit(1);
        }
    }
545835
public function markJobDone($id)
    {
        $entity = $this->get($id);
        $data = ['completed' => true, 'stats' => ['tries' => ($entity->stats['tries'] + 1), 'message' => $entity->stats['message'] . ($entity->stats['tries'] + 1) . '. ' . 'Success!' . PHP_EOL]];
        $this->patchEntity($entity, $data, ['validate' => false]);
        return $this->save($entity);
    }