本文整理汇总了PHP中PFApplicationHelper::getActiveProject方法的典型用法代码示例。如果您正苦于以下问题:PHP PFApplicationHelper::getActiveProject方法的具体用法?PHP PFApplicationHelper::getActiveProject怎么用?PHP PFApplicationHelper::getActiveProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFApplicationHelper
的用法示例。
在下文中一共展示了PFApplicationHelper::getActiveProject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateState
/**
* Method to auto-populate the model state.
* Note: Calling getState in this method will result in recursion.
*
* @return void
*/
protected function populateState()
{
// Initialise variables.
$app = JFactory::getApplication();
$table = $this->getTable();
$key = $table->getKeyName();
// Get the pk of the record from the request.
$pk = JRequest::getInt($key);
$this->setState($this->getName() . '.id', $pk);
if ($pk) {
$table = $this->getTable();
if ($table->load($pk)) {
$project = (int) $table->project_id;
$this->setState($this->getName() . '.project', $project);
PFApplicationHelper::setActiveProject($project);
$item_id = (int) $table->item_id;
$this->setState($this->getName() . '.item_id', $item_id);
$context = $table->context;
$this->setState($this->getName() . '.context', $context);
}
} else {
$item_id = JRequest::getUInt('filter_item_id', 0);
$this->setState($this->getName() . '.item_id', $item_id);
$context = JRequest::getCmd('filter_context', '');
$this->setState($this->getName() . '.context', $context);
$project = (int) PFApplicationHelper::getActiveProject('filter_project');
if ($project) {
$this->setState($this->getName() . '.project', $project);
PFApplicationHelper::setActiveProject($project);
}
}
// Load the parameters.
$value = JComponentHelper::getParams($this->option);
$this->setState('params', $value);
}