public function getByID($id) { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $row = $this->doSelectById($id, $crit, false); return $row; }
public function quickfind($client_name) { $crit = $this->getCriteria(); $crit->addWhere(self::NAME, "%{$client_name}%", Criteria::DB_LIKE); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); return $this->select($crit); }
public function do_execute() { $this->cliEcho("Importing articles ... \n", 'white', 'bold'); \thebuggenie\core\framework\Event::listen('publish', 'fixture_article_loaded', array($this, 'listenPublishFixtureArticleCreated')); $overwrite = (bool) ($this->getProvidedArgument('overwrite', 'no') == 'yes'); \thebuggenie\core\framework\Context::getModule('publish')->loadFixturesArticles(\thebuggenie\core\framework\Context::getScope()->getID(), $overwrite); }
public function markUserNotificationsReadByTypesAndId($types, $id, $user_id) { if (!is_array($types)) { $types = array($types); } $crit = $this->getCriteria(); $crit->addWhere(self::USER_ID, $user_id); if (count($types)) { if (is_array($id)) { $crit->addWhere(self::TARGET_ID, $id, Criteria::DB_IN); } else { $crit->addWhere(self::TARGET_ID, $id); } $crit->addWhere(self::NOTIFICATION_TYPE, $types, Criteria::DB_IN); } $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addUpdate(self::IS_READ, true); $this->doUpdate($crit); $crit = $this->getCriteria(); $crit->addWhere(self::USER_ID, $user_id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere(self::IS_READ, true); $crit->addWhere('notifications.created_at', NOW - 86400 * 30, Criteria::DB_LESS_THAN_EQUAL); $this->doDelete($crit); }
public function deleteProcessedMessages($ids) { $crit = $this->getCriteria(); $crit->addWhere(self::ID, (array) $ids, Criteria::DB_IN); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $res = $this->doDelete($crit); }
public function countTeams() { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere(self::ONDEMAND, false); return $this->doCount($crit); }
public function countWorkflows($scope = null) { $scope = $scope === null ? framework\Context::getScope()->getID() : $scope; $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, $scope); return $this->doCount($crit); }
public function deleteBySearchID($saved_search_id) { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere(self::SEARCH_ID, $saved_search_id); $this->doDelete($crit); }
public function doesGroupNameExist($group_name) { $crit = $this->getCriteria(); $crit->addWhere(self::NAME, $group_name); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); return (bool) $this->doCount($crit); }
public function getAll() { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addOrderBy(self::ID, Criteria::SORT_ASC); return $this->select($crit); }
public function getByTransitionID($transition_id) { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere(self::TRANSITION_ID, $transition_id); return $this->select($crit); }
public function addStarredIssue($user_id, $issue_id) { $crit = $this->getCriteria(); $crit->addInsert(self::ISSUE, $issue_id); $crit->addInsert(self::UID, $user_id); $crit->addInsert(self::SCOPE, framework\Context::getScope()->getID()); $this->doInsert($crit); }
public function addStarredArticle($user_id, $article_id) { $crit = $this->getCriteria(); $crit->addInsert(self::ARTICLE, $article_id); $crit->addInsert(self::UID, $user_id); $crit->addInsert(self::SCOPE, framework\Context::getScope()->getID()); $this->doInsert($crit); }
public function deleteByIssuetypeID($issuetype_id) { $crit = $this->getCriteria(); $crit->addWhere(self::ISSUETYPE_ID, $issuetype_id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $this->doDelete($crit); return true; }
/** * Get all rows by issue ID * @param integer $id * @return \b2db\Row */ public function getByIssueID($id, $scope = null) { $scope = $scope === null ? \thebuggenie\core\framework\Context::getScope()->getID() : $scope; $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, $scope); $crit->addWhere(self::ISSUE_NO, $id); return $this->select($crit); }
public function removeFriendByUserID($user_id, $friend_id) { $crit = $this->getCriteria(); $crit->addWhere(self::UID, $user_id); $crit->addWhere(self::BID, $friend_id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $this->doDelete($crit); }
public function removeEditionComponent($edition_id, $component_id) { $crit = $this->getCriteria(); $crit->addWhere(self::EDITION, $edition_id); $crit->addWhere(self::COMPONENT, $component_id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $res = $this->doDelete($crit); }
protected function _uninstall() { if (framework\Context::getScope()->isDefault()) { $filename = THEBUGGENIE_PATH . THEBUGGENIE_PUBLIC_FOLDER_NAME . DS . 'css' . DS . 'mobile.css'; if (file_exists($filename)) { unlink($filename); } } }
public function addByProjectIDAndMilestoneID($project_id, $milestone_id) { $crit = $this->getCriteria(); $crit->addInsert(self::PROJECT_ID, $project_id); $crit->addInsert(self::MILESTONE_ID, $milestone_id); $crit->addInsert(self::SCOPE, framework\Context::getScope()->getID()); $res = $this->doInsert($crit); return true; }
public function selectAll() { $crit = $this->getCriteria(); $crit->addJoin(Projects::getTable(), Projects::ID, self::PROJECT); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addOrderBy(Projects::NAME, Criteria::SORT_ASC); $crit->addOrderBy(self::NAME, Criteria::SORT_ASC); return $this->select($crit); }
public function getSubCategories($category_name) { $crit = $this->getCriteria(); $crit->addWhere(self::CATEGORY_NAME, $category_name); $crit->addWhere(self::ARTICLE_IS_CATEGORY, true); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addOrderBy(self::CATEGORY_NAME, Criteria::SORT_ASC); $res = $this->doSelect($crit); return $res; }
public function getByIDs($ids) { if (empty($ids)) { return array(); } $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere(self::ID, $ids, Criteria::DB_IN); return $this->select($crit); }
public function saveOptionOrder($options, $customfield_id) { foreach ($options as $key => $option_id) { $crit = $this->getCriteria(); $crit->addUpdate(self::SORT_ORDER, $key + 1); $crit->addWhere(self::CUSTOMFIELD_ID, $customfield_id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $this->doUpdateById($crit, $option_id); } }
public function getKeyFromID($id) { $crit = $this->getCriteria(); $crit->addWhere(self::ID, $id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $row = $this->doSelectOne($crit); if ($row instanceof \b2db\Row) { return $row->get(self::FIELD_KEY); } return null; }
public function getByTransitionID($transition_id) { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere(self::TRANSITION_ID, $transition_id); $actions = array('pre' => array(), 'post' => array()); if ($res = $this->select($crit, false)) { foreach ($res as $rule) { $actions[$rule->isPreOrPost()][$rule->getRule()] = $rule; } } return $actions; }
protected function _getByTypeID($type, $id) { $crit = $this->getCriteria(); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->addWhere($type == 'step' ? self::OUTGOING_STEP_ID : self::WORKFLOW_ID, $id); $return_array = array(); if ($res = $this->doSelect($crit)) { while ($row = $res->getNextRow()) { $return_array[$row->get(self::ID)] = new \thebuggenie\core\entities\WorkflowTransition($row->get(self::ID), $row); } } return $return_array; }
public function saveEstimate($issue_id, $months, $weeks, $days, $hours, $points) { $crit = $this->getCriteria(); $crit->addInsert(self::ESTIMATED_MONTHS, $months); $crit->addInsert(self::ESTIMATED_WEEKS, $weeks); $crit->addInsert(self::ESTIMATED_DAYS, $days); $crit->addInsert(self::ESTIMATED_HOURS, $hours); $crit->addInsert(self::ESTIMATED_POINTS, $points); $crit->addInsert(self::ISSUE_ID, $issue_id); $crit->addInsert(self::EDITED_AT, NOW); $crit->addInsert(self::EDITED_BY, framework\Context::getUser()->getID()); $crit->addInsert(self::SCOPE, framework\Context::getScope()->getID()); $this->doInsert($crit); }
public function getBugReportTypeIDs() { $crit = $this->getCriteria(); $crit->addWhere(self::ICON, 'bug_report'); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $res = $this->doSelect($crit); $retarr = array(); if ($res) { while ($row = $res->getNextRow()) { $retarr[] = $row->get(self::ID); } } return $retarr; }
public function addByUserIdAndIssueId($user_id, $issue_id, $up = true) { $crit = $this->getCriteria(); $crit->addWhere(self::TARGET, $issue_id); $crit->addWhere(self::UID, $user_id); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $res = $this->doDelete($crit); $crit = $this->getCriteria(); $crit->addInsert(self::TARGET, $issue_id); $crit->addInsert(self::UID, $user_id); $crit->addInsert(self::SCOPE, framework\Context::getScope()->getID()); $crit->addInsert(self::VOTE, $up ? 1 : -1); $res = $this->doInsert($crit); return $res->getInsertID(); }
public function getUniqueLinkedArticleNames() { $crit = $this->getCriteria(); $crit->addSelectionColumn(self::LINK_ARTICLE_NAME); $crit->addWhere(self::SCOPE, framework\Context::getScope()->getID()); $crit->setDistinct(); $names = array(); if ($res = $this->doSelect($crit)) { while ($row = $res->getNextRow()) { $article_name = $row->get(self::LINK_ARTICLE_NAME); $names[$article_name] = $article_name; } } return $names; }