/**
  * 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 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'EmailMessageId':
             // Gets the value for intEmailMessageId (Not Null)
             // @return integer
             return $this->intEmailMessageId;
         case 'GroupId':
             // Gets the value for intGroupId
             // @return integer
             return $this->intGroupId;
         case 'CommunicationListId':
             // Gets the value for intCommunicationListId
             // @return integer
             return $this->intCommunicationListId;
         case 'LoginId':
             // Gets the value for intLoginId
             // @return integer
             return $this->intLoginId;
         case 'CommunicationListEntryId':
             // Gets the value for intCommunicationListEntryId
             // @return integer
             return $this->intCommunicationListEntryId;
         case 'PersonId':
             // Gets the value for intPersonId
             // @return integer
             return $this->intPersonId;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'EmailMessage':
             // Gets the value for the EmailMessage object referenced by intEmailMessageId (Not Null)
             // @return EmailMessage
             try {
                 if (!$this->objEmailMessage && !is_null($this->intEmailMessageId)) {
                     $this->objEmailMessage = EmailMessage::Load($this->intEmailMessageId);
                 }
                 return $this->objEmailMessage;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Group':
             // Gets the value for the Group object referenced by intGroupId
             // @return Group
             try {
                 if (!$this->objGroup && !is_null($this->intGroupId)) {
                     $this->objGroup = Group::Load($this->intGroupId);
                 }
                 return $this->objGroup;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CommunicationList':
             // Gets the value for the CommunicationList object referenced by intCommunicationListId
             // @return CommunicationList
             try {
                 if (!$this->objCommunicationList && !is_null($this->intCommunicationListId)) {
                     $this->objCommunicationList = CommunicationList::Load($this->intCommunicationListId);
                 }
                 return $this->objCommunicationList;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Login':
             // Gets the value for the Login object referenced by intLoginId
             // @return Login
             try {
                 if (!$this->objLogin && !is_null($this->intLoginId)) {
                     $this->objLogin = Login::Load($this->intLoginId);
                 }
                 return $this->objLogin;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CommunicationListEntry':
             // Gets the value for the CommunicationListEntry object referenced by intCommunicationListEntryId
             // @return CommunicationListEntry
             try {
                 if (!$this->objCommunicationListEntry && !is_null($this->intCommunicationListEntryId)) {
                     $this->objCommunicationListEntry = CommunicationListEntry::Load($this->intCommunicationListEntryId);
                 }
                 return $this->objCommunicationListEntry;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Person':
             // Gets the value for the Person object referenced by intPersonId
             // @return Person
             try {
                 if (!$this->objPerson && !is_null($this->intPersonId)) {
                     $this->objPerson = Person::Load($this->intPersonId);
                 }
                 return $this->objPerson;
             } 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)
         ////////////////////////////
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Beispiel #2
0
 /**
  * Reload this EmailMessage 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 EmailMessage object.');
     }
     // Reload the Object
     $objReloaded = EmailMessage::Load($this->intId);
     // Update $this's local variables to match
     $this->EmailMessageStatusTypeId = $objReloaded->EmailMessageStatusTypeId;
     $this->dttDateReceived = $objReloaded->dttDateReceived;
     $this->strRawMessage = $objReloaded->strRawMessage;
     $this->strMessageIdentifier = $objReloaded->strMessageIdentifier;
     $this->strSubject = $objReloaded->strSubject;
     $this->strFromAddress = $objReloaded->strFromAddress;
     $this->strResponseHeader = $objReloaded->strResponseHeader;
     $this->strResponseBody = $objReloaded->strResponseBody;
     $this->strErrorMessage = $objReloaded->strErrorMessage;
 }
 /**
  * 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 EmailMessageMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing EmailMessage object creation - defaults to CreateOrEdit
  * @return EmailMessageMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objEmailMessage = EmailMessage::Load($intId);
         // EmailMessage was found -- return it!
         if ($objEmailMessage) {
             return new EmailMessageMetaControl($objParentObject, $objEmailMessage);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a EmailMessage object with PK arguments: ' . $intId);
             }
         }
         // 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 EmailMessageMetaControl($objParentObject, new EmailMessage());
 }
 /**
  * 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 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'EmailMessageId':
             // Gets the value for intEmailMessageId (Not Null)
             // @return integer
             return $this->intEmailMessageId;
         case 'ToAddress':
             // Gets the value for strToAddress (Not Null)
             // @return string
             return $this->strToAddress;
         case 'ErrorFlag':
             // Gets the value for blnErrorFlag
             // @return boolean
             return $this->blnErrorFlag;
         case 'Token':
             // Gets the value for strToken
             // @return string
             return $this->strToken;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'EmailMessage':
             // Gets the value for the EmailMessage object referenced by intEmailMessageId (Not Null)
             // @return EmailMessage
             try {
                 if (!$this->objEmailMessage && !is_null($this->intEmailMessageId)) {
                     $this->objEmailMessage = EmailMessage::Load($this->intEmailMessageId);
                 }
                 return $this->objEmailMessage;
             } 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)
         ////////////////////////////
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }