本文整理汇总了PHP中PHPWS_DB::loadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_DB::loadClass方法的具体用法?PHP PHPWS_DB::loadClass怎么用?PHP PHPWS_DB::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_DB
的用法示例。
在下文中一共展示了PHPWS_DB::loadClass方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* initialize this object (fill the array) with assignment histories
*
* @param int $bannerID banner id of student
* @param int $term term to be searching
* @return boolean flag to signal if the initialization was a success
*/
private function init()
{
$db = new PHPWS_DB('hms_assignment_history');
$db->addWhere('banner_id', $this->bannerId);
$db->loadClass('hms', 'AssignmentHistory.php');
$db->addOrder(array('term DESC', 'assigned_on DESC'));
$result = $db->getObjects('AssignmentHistory');
if (PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
}
if (isset($result)) {
$this->assignmentHistory = $result;
}
return true;
}
示例2: loadAssignment
public function loadAssignment()
{
$db = new PHPWS_DB('hms_assignment');
$db->addWhere('bed_id', $this->id);
$db->addWhere('term', $this->term);
$db->loadClass('hms', 'HMS_Assignment.php');
$result = $db->getObjects('HMS_Assignment');
if (PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
} else {
if ($result == null) {
return true;
} elseif (sizeof($result) > 1) {
PHPWS_Error::log(HMS_MULTIPLE_ASSIGNMENTS, 'hms', 'HMS_Bed::loadAssignment', "bedid : {$this->id}");
return false;
} else {
$this->_curr_assignment = $result[0];
return TRUE;
}
}
}
示例3: loadRooms
/**
* Pulls all the rooms associated with this floor and stores
* them in the _room variable.
*/
public function loadRooms()
{
$db = new PHPWS_DB('hms_room');
$db->addWhere('floor_id', $this->id);
$db->addOrder('room_number', 'ASC');
$db->loadClass('hms', 'HMS_Room.php');
$result = $db->getObjects('HMS_Room');
//test($result);
if (PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
} else {
$this->_rooms =& $result;
return true;
}
}
示例4: loadFloors
/**
* Pulls all the floors associated with this hall and stores them in
* the _floors variable.
*/
public function loadFloors()
{
if (!$this->id) {
$this->_floor = null;
return null;
}
$db = new PHPWS_DB('hms_floor');
$db->addWhere('residence_hall_id', $this->id);
$db->addOrder('floor_number', 'ASC');
$db->loadClass('hms', 'HMS_Floor.php');
$result = $db->getObjects('HMS_Floor');
if (PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
}
$this->_floors =& $result;
return true;
}
示例5: show
/**
* Function called by mod developer to add their
* link or to just show the menu on that item
*/
public static function show()
{
\Layout::addJSHeader("<script type='text/javascript' src='" . PHPWS_SOURCE_HTTP . "javascript/responsive_img/responsive-img.min.js'></script>", 81);
$seen = array();
$key = Key::getCurrent();
if (empty($key) || empty($key->title) || empty($key->url)) {
return;
}
$db = new PHPWS_DB('menus');
$db->addWhere('menu_assoc.key_id', $key->id);
$db->addWhere('id', 'menu_assoc.menu_id');
$db->loadClass('menu', 'Menu_Item.php');
Key::restrictView($db, 'menu');
$result = $db->getObjects('Menu_Item');
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
} elseif (!empty($result)) {
foreach ($result as $menu) {
$seen[] = $menu->id;
if ($menu->assoc_image) {
Layout::set($menu->showAssocImage(), 'menu', 'image');
}
Layout::set($menu->view(), 'menu', 'menu_' . $menu->id);
}
}
}
示例6: loadBeds
/**
* Pulls all beds associated with this room and stores them in
* the _beds variable.
*
*/
public function loadBeds()
{
$db = new PHPWS_DB('hms_bed');
$db->addWhere('room_id', $this->id);
$db->addOrder('bedroom_label', 'ASC');
$db->addOrder('bed_letter', 'ASC');
$db->loadClass('hms', 'HMS_Bed.php');
$result = $db->getObjects('HMS_Bed');
if (PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
} else {
$this->_beds =& $result;
return true;
}
}
示例7: getEntries
public static function getEntries(PHPWS_DB $db, $limit, $offset = 0)
{
$db->resetColumns();
$db->setLimit($limit, $offset);
$db->addOrder('sticky desc');
$db->addOrder('publish_date desc');
$db->loadClass('blog', 'Blog.php');
return $db->getObjects('Blog');
}