本文整理汇总了PHP中PHPWS_Core::initModclass方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Core::initModclass方法的具体用法?PHP PHPWS_Core::initModclass怎么用?PHP PHPWS_Core::initModclass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Core
的用法示例。
在下文中一共展示了PHPWS_Core::initModclass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute(CommandContext $context)
{
if (!Current_User::allow('withdrawn_search')) {
PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
throw new PermissionException('You do not have permission to makr applications withdrawn.');
}
$id = $context->get('appId');
if (!isset($id) || is_null($id)) {
throw new InvalidArugumentException('Missing application id.');
}
PHPWS_Core::initModclass('hms', 'HousingApplicationFactory.php');
$app = HousingApplicationFactory::getApplicationById($context->get('appId'));
$app->setWithdrawn(1);
$app->save();
NQ::simple('hms', hms\NotificationView::SUCCESS, 'Application successfully marked as withdrawn.');
$context->goBack();
}
示例2: send_roommate_reminder_emails
public static function send_roommate_reminder_emails($term)
{
PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
PHPWS_Core::initModclass('hms', 'StudentFactory.php');
// Get a list of outstanding roommate requests, send them reminder emails
$query = "select hms_lottery_reservation.* FROM hms_lottery_reservation\n LEFT OUTER JOIN (SELECT asu_username FROM hms_assignment WHERE term={$term} AND lottery = 1) as foo ON hms_lottery_reservation.asu_username = foo.asu_username\n WHERE foo.asu_username IS NULL\n AND hms_lottery_reservation.expires_on > " . time();
$result = PHPWS_DB::getAll($query);
if (PEAR::isError($result)) {
PHPWS_Error::log($result);
test($result, 1);
}
$year = Term::toString($term) . ' - ' . Term::toString(Term::getNextTerm($term));
foreach ($result as $row) {
$student = StudentFactory::getStudentByUsername($row['asu_username'], $term);
$requestor = StudentFactory::getStudentByUsername($row['requestor'], $term);
$bed = new HMS_Bed($row['bed_id']);
$hall_room = $bed->where_am_i();
HMS_Email::send_lottery_roommate_reminder($row['asu_username'], $student->getName(), $row['expires_on'], $requestor->getName(), $hall_room, $year);
HMS_Activity_Log::log_activity($row['asu_username'], ACTIVITY_LOTTERY_ROOMMATE_REMINDED, 'hms');
}
}