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


PHP PHPWS_Error::message方法代码示例

本文整理汇总了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;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:83,代码来源:Manager.php


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