本文整理汇总了PHP中Notification::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::Load方法的具体用法?PHP Notification::Load怎么用?PHP Notification::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::Load方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNotificationByTypeAndDate
public function getNotificationByTypeAndDate($type, $date)
{
$noti = new Notification();
$noti->Load("date(time) = ? and type = ?", array($date, $type));
if (!empty($noti->id) && ($noti->type = $type)) {
return $noti;
}
return null;
}
示例2: SetupNotification
protected function SetupNotification()
{
// Lookup Object PK information from Query String (if applicable)
// Set mode to Edit or New depending on what's found
$intNotificationId = QApplication::QueryString('intNotificationId');
if ($intNotificationId) {
$this->objNotification = Notification::Load($intNotificationId);
if (!$this->objNotification) {
throw new Exception('Could not find a Notification object with PK arguments: ' . $intNotificationId);
}
$this->strTitleVerb = QApplication::Translate('Edit');
$this->blnEditMode = true;
} else {
$this->objNotification = new Notification();
$this->strTitleVerb = QApplication::Translate('Create');
$this->blnEditMode = false;
}
}
示例3: Reload
/**
* Reload this Notification from the database.
* @return void
*/
public function Reload()
{
// Make sure we are actually Restored from the database
if (!$this->__blnRestored) {
throw new QCallerException('Cannot call Reload() on a new, unsaved Notification object.');
}
// Reload the Object
$objReloaded = Notification::Load($this->intNotificationId);
// Update $this's local variables to match
$this->strShortDescription = $objReloaded->strShortDescription;
$this->strLongDescription = $objReloaded->strLongDescription;
$this->strCriteria = $objReloaded->strCriteria;
$this->strFrequency = $objReloaded->strFrequency;
$this->blnEnabledFlag = $objReloaded->blnEnabledFlag;
$this->CreatedBy = $objReloaded->CreatedBy;
$this->dttCreationDate = $objReloaded->dttCreationDate;
$this->ModifiedBy = $objReloaded->ModifiedBy;
$this->strModifiedDate = $objReloaded->strModifiedDate;
}
示例4: btnEdit_Click
public function btnEdit_Click($strFormId, $strControlId, $strParameter)
{
$strParameterArray = explode(',', $strParameter);
$objNotification = Notification::Load($strParameterArray[0]);
$objEditPanel = new NotificationEditPanel($this, $this->strCloseEditPanelMethod, $objNotification);
$strMethodName = $this->strSetEditPanelMethod;
$this->objForm->{$strMethodName}($objEditPanel);
}
示例5: Create
/**
* Static Helper Method to Create using PK arguments
* You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
* If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
* static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
* edit, or if we are also allowed to create a new one, etc.
*
* @param mixed $objParentObject QForm or QPanel which will be using this NotificationMetaControl
* @param integer $intNotificationId primary key value
* @param QMetaControlCreateType $intCreateType rules governing Notification object creation - defaults to CreateOrEdit
* @return NotificationMetaControl
*/
public static function Create($objParentObject, $intNotificationId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
{
// Attempt to Load from PK Arguments
if (strlen($intNotificationId)) {
$objNotification = Notification::Load($intNotificationId);
// Notification was found -- return it!
if ($objNotification) {
return new NotificationMetaControl($objParentObject, $objNotification);
} else {
if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
throw new QCallerException('Could not find a Notification object with PK arguments: ' . $intNotificationId);
}
}
// If EditOnly is specified, throw an exception
} else {
if ($intCreateType == QMetaControlCreateType::EditOnly) {
throw new QCallerException('No PK arguments specified');
}
}
// If we are here, then we need to create a new record
return new NotificationMetaControl($objParentObject, new Notification());
}
示例6: __get
/**
* Override method to perform a property "Get"
* This will get the value of $strName
*
* @param string $strName Name of the property to get
* @return mixed
*/
public function __get($strName)
{
switch ($strName) {
///////////////////
// Member Variables
///////////////////
case 'NotificationUserAccountId':
/**
* Gets the value for intNotificationUserAccountId (Read-Only PK)
* @return integer
*/
return $this->intNotificationUserAccountId;
case 'UserAccountId':
/**
* Gets the value for intUserAccountId (Not Null)
* @return integer
*/
return $this->intUserAccountId;
case 'NotificationId':
/**
* Gets the value for intNotificationId (Not Null)
* @return integer
*/
return $this->intNotificationId;
case 'Level':
/**
* Gets the value for strLevel
* @return string
*/
return $this->strLevel;
///////////////////
// Member Objects
///////////////////
///////////////////
// Member Objects
///////////////////
case 'UserAccount':
/**
* Gets the value for the UserAccount object referenced by intUserAccountId (Not Null)
* @return UserAccount
*/
try {
if (!$this->objUserAccount && !is_null($this->intUserAccountId)) {
$this->objUserAccount = UserAccount::Load($this->intUserAccountId);
}
return $this->objUserAccount;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'Notification':
/**
* Gets the value for the Notification object referenced by intNotificationId (Not Null)
* @return Notification
*/
try {
if (!$this->objNotification && !is_null($this->intNotificationId)) {
$this->objNotification = Notification::Load($this->intNotificationId);
}
return $this->objNotification;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
////////////////////////////
// Virtual Object References (Many to Many and Reverse References)
// (If restored via a "Many-to" expansion)
////////////////////////////
////////////////////////////
// Virtual Object References (Many to Many and Reverse References)
// (If restored via a "Many-to" expansion)
////////////////////////////
default:
try {
return parent::__get($strName);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}