本文整理匯總了PHP中PHPWS_Error::message方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHPWS_Error::message方法的具體用法?PHP PHPWS_Error::message怎麽用?PHP PHPWS_Error::message使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHPWS_Error
的用法示例。
在下文中一共展示了PHPWS_Error::message方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getItems
/**
* Creates a 2 dimensional array of items from the current table.
*
* This function creates an sql statement based on variables currently set in
* this object. The statement is then executed on the current table and it's
* result is returned as the list of current items.
*
* @param boolean $filterGroups Flag whether or not to filter items that are not
* associated with a users group
* @return mixed A 2-dimentional array of items or FALSE on failure.
* @access public
* @see getList()
*/
function getItems($ids = NULL, $filterGroups = FALSE, $everything = FALSE)
{
if (isset($this->_table)) {
$table = $this->_table;
} else {
$table = $this->_tables[$this->listName];
}
/* Make sure the table name is set before continuing */
if (isset($table)) {
if (is_array($this->_listColumns[$this->listName])) {
if ($everything) {
$sql = 'SELECT *';
} else {
$sql = 'SELECT id, ';
foreach ($this->_listColumns[$this->listName] as $listColumn => $listLabel) {
if ($listColumn != 'id') {
$sql .= $listColumn . ', ';
}
}
$sql = substr($sql, 0, strlen($sql) - 2);
}
$sql .= ' FROM ' . $table;
} else {
$error = new PHPWS_Error('core', 'PHPWS_Manager:getItems()', 'Format error in config file.', 'exit', 1);
$error->message(NULL);
}
} else {
$error = new PHPWS_Error('core', 'PHPWS_Manager:getItems()', 'Table not set!', 'exit', 1);
$error->message(NULL);
}
$whereFlag = FALSE;
$sort = $this->getSort();
if (isset($sort)) {
$sql .= $sort;
$whereFlag = TRUE;
}
if (is_array($ids) && sizeof($ids) > 0) {
if ($whereFlag) {
$sql .= ' AND (';
} else {
$sql .= ' WHERE (';
}
foreach ($ids as $id) {
$sql .= " id='{$id}' OR ";
}
$sql = substr($sql, 0, strlen($sql) - 4) . ')';
}
$order = $this->getOrder();
if (isset($order)) {
$sql .= $order;
}
/* Set associative mode for db and execute query */
$result = PHPWS_DB::getAll($sql);
if ($filterGroups) {
$size = sizeof($result);
for ($i = 0; $i < $size; $i++) {
$groups = unserialize($result[$i]['groups']);
if (is_array($groups)) {
foreach ($groups as $value) {
if (!$_SESSION['OBJ_user']->userInGroup($value)) {
unset($result[$i]);
}
}
}
}
$result = PHPWS_Array::reIndex($result);
}
/* Return result of query */
return $result;
}