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


PHP PHPWS_Error::isError方法代码示例

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


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

示例1: execute

 public function execute()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     $term = $this->term;
     $db = new PHPWS_DB('hms_checkin');
     // Join hall structure
     $db->addJoin('', 'hms_checkin', 'hms_hall_structure', 'bed_id', 'bedid');
     $db->addColumn('hms_checkin.banner_id');
     $db->addColumn('hms_checkin.checkin_date');
     $db->addColumn('hms_hall_structure.hall_name');
     $db->addColumn('hms_hall_structure.room_number');
     $db->addWhere('hms_checkin.term', $term);
     $db->addWhere('hms_checkin.checkout_date', null, 'IS NULL');
     // Sort by hall, then room number
     $db->addOrder(array('hms_hall_structure.hall_name ASC', 'hms_hall_structure.room_number ASC'));
     $results = $db->select();
     if (PHPWS_Error::isError($results)) {
         throw new DatabaseException($results->toString());
     }
     // Post-processing, cleanup, making it pretty
     foreach ($results as $row) {
         // Updates counts
         $this->total++;
         $row['checkin_date'] = HMS_Util::get_short_date_time($row['checkin_date']);
         // Copy the cleaned up row to the member var for data
         $this->data[] = $row;
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:28,代码来源:CheckinList.php

示例2: __construct

 public function __construct($name = NULL, $data = NULL, $id = NULL, $type = NULL)
 {
     $editorList = $this->getEditorList();
     if (PHPWS_Error::isError($editorList)) {
         PHPWS_Error::log($editorList);
         $this->type = null;
         return;
     }
     if (empty($type)) {
         $type = $this->getUserType();
     }
     $this->editorList = $editorList;
     if (isset($type)) {
         $result = $this->setType($type);
         if (PHPWS_Error::isError($result)) {
             PHPWS_Error::log($result);
             $this->type = null;
             return;
         }
     }
     if (isset($id)) {
         $this->id = $id;
     }
     if (isset($name)) {
         $this->setName($name);
         if (empty($this->id)) {
             $this->id = $name;
         }
     }
     if (isset($data)) {
         $this->setData(trim($data));
     }
 }
开发者ID:par-orillonsoft,项目名称:phpwebsite,代码行数:33,代码来源:Editor.php

示例3: menu_unregister_key

/**
 * unregisters deleted keys from menu
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function menu_unregister_key(Key $key)
{
    PHPWS_Core::initModClass('menu', 'Menu_Link.php');
    if (empty($key) || empty($key->id)) {
        return FALSE;
    }
    $db = new PHPWS_DB('menu_links');
    $db->addWhere('key_id', $key->id);
    $result = $db->delete();
    if (PHPWS_Error::isError($result)) {
        PHPWS_Error::log($result);
    }
    $db2 = new PHPWS_DB('menu_assoc');
    $db2->addWhere('key_id', $key->id);
    $result = $db2->delete();
    if (PHPWS_Error::isError($result)) {
        PHPWS_Error::log($result);
    }
    $db3 = new PHPWS_DB('menus');
    $db3->addWhere('assoc_key', $key->id);
    $db3->addValue('assoc_key', 0);
    $db3->addValue('assoc_url', null);
    $db3->update();
    return true;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:31,代码来源:key.php

示例4: execute

 public function execute()
 {
     $this->checkinCounts = PHPWS_DB::getAssoc("select hall_name, count(*) from hms_checkin JOIN hms_hall_structure ON hms_checkin.bed_id = hms_hall_structure.bedid WHERE term = {$this->term} and checkout_date IS NULL GROUP BY hall_name ORDER BY hall_name");
     if (PHPWS_Error::isError($this->checkinCounts)) {
         throw new DatabaseException($this->checkinCounts->toString());
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:7,代码来源:CheckinsByHall.php

示例5: users_register

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function users_register($module, &$content)
{
    PHPWS_Core::initModClass('users', 'Permission.php');
    PHPWS_Core::initModClass('users', 'My_Page.php');
    $no_permissions = $no_my_page = FALSE;
    $result = Users_Permission::createPermissions($module);
    if (is_null($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'Permissions file not implemented.'));
        $content[] = dgettext('users', 'Permissions file not implemented.');
        $no_permissions = TRUE;
    } elseif (PHPWS_Error::isError($result)) {
        $content[] = dgettext('users', 'Permissions table not created successfully.');
        PHPWS_Error::log($result);
        return FALSE;
    } else {
        $content[] = dgettext('users', 'Permissions table created successfully.');
    }
    $result = My_Page::registerMyPage($module);
    if (PHPWS_Error::isError($result)) {
        PHPWS_Boost::addLog('users', dgettext('users', 'A problem occurred when trying to register this module to My Page.'));
        $content[] = dgettext('users', 'A problem occurred when trying to register this module to My Page.');
        return FALSE;
    } elseif ($result != FALSE) {
        $content[] = dgettext('users', 'My Page registered to Users module.');
    } else {
        $no_my_page = TRUE;
    }
    // If the module doesn't have permissions or a My Page
    // then don't register the module
    if ($no_permissions && $no_my_page) {
        return FALSE;
    } else {
        return TRUE;
    }
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:39,代码来源:register.php

示例6: dropSequence

 public function dropSequence($table)
 {
     $table = PHPWS_DB::addPrefix($table);
     $result = $GLOBALS['PHPWS_DB']['connection']->query("DROP TABLE {$table}");
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     return TRUE;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:9,代码来源:mysql.php

示例7: calendar_uninstall

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function calendar_uninstall(&$content)
{
    PHPWS_Core::initModClass('calendar', 'Schedule.php');
    // Need functions to remove old event tables
    $db = new PHPWS_DB('calendar_schedule');
    $schedules = $db->getObjects('Calendar_Schedule');
    if (PHPWS_Error::isError($schedules)) {
        return $schedules;
    } elseif (empty($schedules)) {
        $result = PHPWS_DB::dropTable('calendar_schedule');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        $result = PHPWS_DB::dropTable('calendar_notice');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        $result = PHPWS_DB::dropTable('calendar_suggestions');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        return true;
    }
    $error = false;
    foreach ($schedules as $sch) {
        $result = $sch->delete();
        if (PHPWS_Error::isError($result)) {
            PHPWS_Error::log($result);
            $error = true;
        }
    }
    $result = PHPWS_DB::dropTable('calendar_schedule');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    $result = PHPWS_DB::dropTable('calendar_notice');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    $result = PHPWS_DB::dropTable('calendar_suggestions');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    if (PHPWS_DB::isTable('converted')) {
        $db2 = new PHPWS_DB('converted');
        $db2->addWhere('convert_name', array('schedule', 'calendar'));
        $db2->delete();
        $content[] = dgettext('calendar', 'Removed convert flag.');
    }
    if (!$error) {
        $content[] = dgettext('calendar', 'Calendar tables removed.');
    } else {
        $content[] = dgettext('calendar', 'Some errors occurred when uninstalling Calendar.');
    }
    return true;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:60,代码来源:uninstall.php

示例8: init

 public function init()
 {
     $db = new PHPWS_DB('search');
     $db->addWhere('key_id', $this->key_id);
     $result = $db->loadObject($this);
     if (PHPWS_Error::isError($result)) {
         $this->_error = $result;
     }
     $this->loadKeywords();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:10,代码来源:Search.php

示例9: init

 public function init()
 {
     $db = new PHPWS_DB('signup_peeps');
     $result = $db->loadObject($this);
     if (PHPWS_Error::isError($result)) {
         $this->_error = $result;
     } elseif (!$result) {
         $this->id = 0;
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:10,代码来源:Peeps.php

示例10: save

 public function save($key_id)
 {
     $db = new PHPWS_DB('ps_text');
     $result = $db->saveObject($this);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $search = new Search($key_id);
     $search->addKeywords($this->content);
     return $search->save();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:11,代码来源:PS_Text.php

示例11: delete

 public function delete()
 {
     $db = new \PHPWS_DB('prop_roommate');
     $db->addWhere('id', $this->id);
     $result = $db->delete();
     if (\PHPWS_Error::isError($result)) {
         \PHPWS_Error::log($result);
         return false;
     } else {
         return true;
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:Roommate.php

示例12: __construct

 public function __construct($xml_file, $die_on_error = true)
 {
     $this->filename = $xml_file;
     $this->xml = xml_parser_create();
     xml_parser_set_option($this->xml, XML_OPTION_TARGET_ENCODING, 'UTF-8');
     xml_set_object($this->xml, $this);
     xml_set_element_handler($this->xml, 'startHandler', 'endHandler');
     xml_set_character_data_handler($this->xml, 'dataHandler');
     $result = $this->parse($xml_file, $die_on_error);
     if (PHPWS_Error::isError($result)) {
         $this->error = $result;
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:XMLParser.php

示例13: init

 public function init()
 {
     $db = new PHPWS_DB('menu_links');
     $result = $db->loadObject($this);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     if (!$result) {
         $this->id = 0;
         return false;
     }
     $this->loadChildren();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:Menu_Link.php

示例14: delete

 public function delete()
 {
     $result = parent::delete();
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $db = new PHPWS_DB('analytics_tracker_piwik');
     $db->addWhere('id', $this->id);
     $result = $db->delete();
     if (PHPWS_Error::logIfError($result)) {
         return $result;
     }
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:PiwikTracker.php

示例15: rss_unregister

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function rss_unregister($module, &$content)
{
    $db = new PHPWS_DB('rssfeeds');
    $db->addWhere('module', $module);
    $result = $db->delete();
    if (PHPWS_Error::isError($result)) {
        PHPWS_Error::log($result);
        $content[] = dgettext('rss', 'An error occurred trying to unregister this module from RSSFeeds.');
        return FALSE;
    } else {
        $content[] = dgettext('rss', 'Module unregistered from RSSFeeds.');
        return TRUE;
    }
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:18,代码来源:unregister.php


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