本文整理汇总了PHP中CRM_Core_Page::get方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Page::get方法的具体用法?PHP CRM_Core_Page::get怎么用?PHP CRM_Core_Page::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Page
的用法示例。
在下文中一共展示了CRM_Core_Page::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Class constructor
*
* @param CRM_Core_Selector_API $object an object that implements the selector API
* @param int $pageID default pageID
* @param int $sortID default sortID
* @param int $action the actions to potentially support
* @param CRM_Core_Page|CRM_Core_Form $store place in session to store some values
* @param int $output what do we so with the output, session/template//both
*
* @return Object
* @access public
*/
function __construct($object, $pageID, $sortID, $action, $store = NULL, $output = self::TEMPLATE, $prefix = NULL, $case = NULL)
{
$this->_object = $object;
$this->_pageID = $pageID ? $pageID : 1;
$this->_sortID = $sortID ? $sortID : NULL;
$this->_action = $action;
$this->_store = $store;
$this->_output = $output;
$this->_prefix = $prefix;
$this->_case = $case;
// fix sortID
if ($this->_sortID && strpos($this->_sortID, '_') === FALSE) {
$this->_sortID .= '_u';
}
$params = array('pageID' => $this->_pageID);
// let the constructor initialize this, should happen only once
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
}
$this->_sortOrder =& $this->_object->getSortOrder($action);
$this->_sort = new CRM_Utils_Sort($this->_sortOrder, $this->_sortID);
/*
* if we are in transfer mode, do not goto database, use the
* session values instead
*/
if ($output == self::TRANSFER) {
$params['total'] = $this->_store->get($this->_prefix . 'rowCount');
} else {
$params['total'] = $this->_object->getTotalCount($action, $this->_case);
}
$this->_total = $params['total'];
$this->_object->getPagerParams($action, $params);
/*
* Set the default values of RowsPerPage
*/
$storeRowCount = $store->get($this->_prefix . CRM_Utils_Pager::PAGE_ROWCOUNT);
if ($storeRowCount) {
$params['rowCount'] = $storeRowCount;
} elseif (!isset($params['rowCount'])) {
$params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
}
$this->_pager = new CRM_Utils_Pager($params);
list($this->_pagerOffset, $this->_pagerRowCount) = $this->_pager->getOffsetAndRowCount();
}
示例2: array
/**
* Class constructor
*
* @param CRM_Core_Selector_API $object an object that implements the selector API
* @param int $pageID default pageID
* @param int $sortID default sortID
* @param int $action the actions to potentially support
* @param CRM_Core_Page|CRM_Core_Form $store place in session to store some values
* @param int $output what do we so with the output, session/template//both
*
* @return Object
* @access public
*/
function CRM_Core_Selector_Controller($object, $pageID, $sortID, $action, $store = null, $output = CRM_CORE_SELECTOR_CONTROLLER_TEMPLATE)
{
$this->_object = $object;
$this->_pageID = $pageID ? $pageID : 1;
$this->_sortID = $sortID ? $sortID : null;
$this->_action = $action;
$this->_store = $store;
$this->_output = $output;
// fix sortID
if ($this->_sortID && strpos($this->_sortID, '_') === false) {
$this->_sortID .= '_u';
}
$params = array('pageID' => $this->_pageID);
// let the constructor initialize this, should happen only once
if (!isset($GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template'])) {
$GLOBALS['_CRM_CORE_SELECTOR_CONTROLLER']['_template'] =& CRM_Core_Smarty::singleton();
}
$this->_sortOrder =& $this->_object->getSortOrder($action);
$this->_sort =& new CRM_Utils_Sort($this->_sortOrder, $this->_sortID);
/*
* if we are in transfer mode, do not goto database, use the
* session values instead
*/
if ($output == CRM_CORE_SELECTOR_CONTROLLER_TRANSFER) {
$params['total'] = $this->_store->get('rowCount');
} else {
$params['total'] = $this->_object->getTotalCount($action);
}
$this->_total = $params['total'];
$this->_object->getPagerParams($action, $params);
/*
* Set the default values of RowsPerPage
*/
$storeRowCount = $store->get(CRM_UTILS_PAGER_PAGE_ROWCOUNT);
if ($storeRowCount) {
$params['rowCount'] = $storeRowCount;
} else {
if (!isset($params['rowCount'])) {
$params['rowCount'] = CRM_UTILS_PAGER_ROWCOUNT;
}
}
$this->_pager =& new CRM_Utils_Pager($params);
list($this->_pagerOffset, $this->_pagerRowCount) = $this->_pager->getOffsetAndRowCount();
}