当前位置: 首页>>代码示例>>PHP>>正文


PHP TBGContext::factory方法代码示例

本文整理汇总了PHP中TBGContext::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext::factory方法的具体用法?PHP TBGContext::factory怎么用?PHP TBGContext::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TBGContext的用法示例。


在下文中一共展示了TBGContext::factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getScope

 public function getScope()
 {
     if (!$this->_scope instanceof TBGScope) {
         $this->_scope = TBGContext::factory()->TBGScope($this->_scope);
     }
     return $this->_scope;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:7,代码来源:TBGIdentifiableClass.class.php

示例2: getByValueAndKey

 /**
  * Return a custom data type option by value and key
  *
  * @param string|integer $value
  * @param string $key
  *
  * @return TBGCustomDatatypeOption
  */
 public static function getByValueAndKey($value, $key)
 {
     $row = B2DB::getTable('TBGCustomFieldOptionsTable')->getByValueAndKey($value, $key);
     if ($row) {
         return TBGContext::factory()->TBGCustomDatatypeOption($row->get(TBGCustomFieldOptionsTable::ID), $row);
     }
     return null;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:16,代码来源:TBGCustomDatatypeOption.class.php

示例3: createNew

 /**
  * Create a new status
  *
  * @param string $name The status description
  * @param string $itemdata[optional] The color if any (default FFF)
  *
  * @return TBGStatus
  */
 public static function createNew($name, $itemdata = null)
 {
     $itemdata = $itemdata === null || trim($itemdata) == '' ? '#FFF' : $itemdata;
     if (substr($itemdata, 0, 1) != '#') {
         $itemdata = '#' . $itemdata;
     }
     $res = parent::_createNew($name, self::STATUS, $itemdata);
     return TBGContext::factory()->TBGStatus($res->getInsertID());
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:17,代码来源:TBGStatus.class.php

示例4: getAll

 public static function getAll()
 {
     if (self::$_groups === null) {
         self::$_groups = array();
         if ($res = TBGGroupsTable::getTable()->getAll()) {
             while ($row = $res->getNextRow()) {
                 self::$_groups[$row->get(TBGGroupsTable::ID)] = TBGContext::factory()->TBGGroup($row->get(TBGGroupsTable::ID), $row);
             }
         }
     }
     return self::$_groups;
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:12,代码来源:TBGGroup.class.php

示例5: getAll

 /**
  * Returns all categories available
  * 
  * @return array 
  */
 public static function getAll()
 {
     if (self::$_items === NULL) {
         self::$_items = array();
         if ($items = TBGListTypesTable::getTable()->getAllByItemType(self::CATEGORY)) {
             foreach ($items as $row_id => $row) {
                 self::$_items[$row_id] = TBGContext::factory()->TBGCategory($row_id, $row);
             }
         }
     }
     return self::$_items;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:17,代码来源:TBGCategory.class.php

示例6: getProjectsByTeamID

 public function getProjectsByTeamID($team_id)
 {
     $projects = array();
     $crit = $this->getCriteria();
     $crit->addWhere(self::TID, $team_id);
     if ($res = $this->doSelect($crit)) {
         foreach ($res->getNextRow() as $row) {
             $projects[$row->get(TBGComponentsTable::PROJECT)] = TBGContext::factory()->TBGProject($row->get(TBGComponentsTable::PROJECT));
         }
     }
     return $projects;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:12,代码来源:TBGComponentAssigneesTable.class.php

示例7: preExecute

 /**
  * The currently selected project in actions where there is one
  *
  * @access protected
  * @property TBGProject $selected_project
  */
 public function preExecute(TBGRequest $request, $action)
 {
     try {
         if ($project_key = $request->getParameter('project_key')) {
             $this->selected_project = TBGProject::getByKey($project_key);
         } elseif ($project_id = (int) $request->getParameter('project_id')) {
             $this->selected_project = TBGContext::factory()->TBGProject($project_id);
         }
         TBGContext::setCurrentProject($this->selected_project);
     } catch (Exception $e) {
     }
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:18,代码来源:actions.class.php

示例8: getByTransitionID

 public function getByTransitionID($transition_id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $crit->addWhere(self::TRANSITION_ID, $transition_id);
     $actions = array('pre' => array(), 'post' => array());
     if ($res = $this->doSelect($crit, false)) {
         while ($row = $res->getNextRow()) {
             $actions[$row->get(self::PRE_OR_POST)][$row->get(self::RULE)] = TBGContext::factory()->TBGWorkflowTransitionValidationRule($row->get(self::ID), $row);
         }
     }
     return $actions;
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:13,代码来源:TBGWorkflowTransitionValidationRulesTable.class.php

示例9: _getByTypeID

 protected function _getByTypeID($type, $id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::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)] = TBGContext::factory()->TBGWorkflowTransition($row->get(self::ID), $row);
         }
     }
     return $return_array;
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:13,代码来源:TBGWorkflowTransitionsTable.class.php

示例10: preExecute

 /**
  * The currently selected project in actions where there is one
  *
  * @access protected
  * @property TBGProject $selected_project
  */
 public function preExecute(TBGRequest $request, $action)
 {
     try {
         if ($project_key = $request['project_key']) {
             $this->selected_project = TBGProject::getByKey($project_key);
         } elseif ($project_id = (int) $request['project_id']) {
             $this->selected_project = TBGContext::factory()->TBGProject($project_id);
         }
         if ($this->selected_project instanceof TBGProject) {
             TBGContext::setCurrentProject($this->selected_project);
         }
     } catch (Exception $e) {
     }
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:20,代码来源:actions.class.php

示例11: getAll

 public static function getAll()
 {
     if (self::$_userstates === null) {
         if (!($states = TBGCache::get(TBGCache::KEY_USERSTATES_CACHE))) {
             $res = TBGUserStateTable::getTable()->doSelectAll();
             $states = array();
             while ($row = $res->getNextRow()) {
                 $states[$row->get(TBGUserStateTable::ID)] = TBGContext::factory()->TBGUserstate($row->get(TBGUserStateTable::ID), $row);
             }
             TBGCache::add(TBGCache::KEY_USERSTATES_CACHE, $states);
         }
         self::$_userstates = $states;
     }
     return self::$_userstates;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:15,代码来源:TBGUserstate.class.php

示例12: getByIssueID

 public function getByIssueID($issue_id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::ISSUE_ID, $issue_id);
     $res = $this->doSelect($crit);
     $ret_arr = array();
     if ($res) {
         while ($row = $res->getNextRow()) {
             $file = TBGContext::factory()->TBGFile($row->get(TBGFilesTable::ID), $row);
             $file->setUploadedAt($row->get(self::ATTACHED_AT));
             $ret_arr[$row->get(TBGFilesTable::ID)] = $file;
         }
     }
     return $ret_arr;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:15,代码来源:TBGIssueFilesTable.class.php

示例13: _populateSchemes

 protected static function _populateSchemes()
 {
     if (self::$_schemes === null) {
         self::$_schemes = array();
         if ($res = TBGIssuetypeSchemesTable::getTable()->getAll()) {
             while ($row = $res->getNextRow()) {
                 $scheme = TBGContext::factory()->TBGIssuetypeScheme($row->get(TBGIssuetypeSchemesTable::ID), $row);
                 if (self::$_core_scheme === null) {
                     self::$_core_scheme = $scheme;
                 }
                 self::$_schemes[$row->get(TBGIssuetypeSchemesTable::ID)] = $scheme;
             }
         }
     }
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:15,代码来源:TBGIssuetypeScheme.class.php

示例14: _populateWorkflows

 protected static function _populateWorkflows()
 {
     if (self::$_workflows === null) {
         self::$_workflows = array();
         if ($res = TBGWorkflowsTable::getTable()->getAll()) {
             while ($row = $res->getNextRow()) {
                 $workflow = TBGContext::factory()->TBGWorkflow($row->get(TBGWorkflowsTable::ID), $row);
                 if (self::$_core_workflow === null) {
                     self::$_core_workflow = $workflow;
                 }
                 self::$_workflows[$row->get(TBGWorkflowsTable::ID)] = $workflow;
             }
         }
     }
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:15,代码来源:TBGWorkflow.class.php

示例15: _getIdentifiable

 /**
  * Return the identifiable object for a specific field
  *
  * @param string $field
  *
  * @return TBGIdentifiable
  */
 protected function _getIdentifiable($field)
 {
     if (is_numeric($this->{$field})) {
         $type_field = "{$field}_type";
         try {
             if ($this->{$type_field} == TBGIdentifiableClass::TYPE_USER) {
                 $this->{$field} = TBGContext::factory()->TBGUser($this->{$field});
             } elseif ($this->{$type_field} == TBGIdentifiableClass::TYPE_TEAM) {
                 $this->{$field} = TBGContext::factory()->TBGTeam($this->{$field});
             }
         } catch (Exception $e) {
             $this->{$field} = null;
             $this->{$type_field} = null;
         }
     }
     return $this->{$field};
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:24,代码来源:TBGOwnableItem.class.php


注:本文中的TBGContext::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。