Exemplo n.º 1
0
 /**
  * Instantiate a MemberAsset from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this MemberAsset::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return MemberAsset
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the MemberAsset object
     $objToReturn = new MemberAsset();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'member_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'member_id'] : $strAliasPrefix . 'member_id';
     $objToReturn->intMemberId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'asset_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'asset_id'] : $strAliasPrefix . 'asset_id';
     $objToReturn->intAssetId = $objDbRow->GetColumn($strAliasName, 'Integer');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'member_asset__';
     }
     // Check for Member Early Binding
     $strAlias = $strAliasPrefix . 'member_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objMember = Memberdetails::InstantiateDbRow($objDbRow, $strAliasPrefix . 'member_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Asset Early Binding
     $strAlias = $strAliasPrefix . 'asset_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objAsset = Myassets::InstantiateDbRow($objDbRow, $strAliasPrefix . 'asset_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
 /**
  * Instantiate a DatagridColumnPreference from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DatagridColumnPreference::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return DatagridColumnPreference
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DatagridColumnPreference object
     $objToReturn = new DatagridColumnPreference();
     $objToReturn->__blnRestored = true;
     $objToReturn->intDatagridColumnPreferenceId = $objDbRow->GetColumn($strAliasPrefix . 'datagrid_column_preference_id', 'Integer');
     $objToReturn->intDatagridId = $objDbRow->GetColumn($strAliasPrefix . 'datagrid_id', 'Integer');
     $objToReturn->strColumnName = $objDbRow->GetColumn($strAliasPrefix . 'column_name', 'VarChar');
     $objToReturn->intUserAccountId = $objDbRow->GetColumn($strAliasPrefix . 'user_account_id', 'Integer');
     $objToReturn->blnDisplayFlag = $objDbRow->GetColumn($strAliasPrefix . 'display_flag', 'Bit');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'datagrid_column_preference__';
     }
     // Check for Datagrid Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'datagrid_id__datagrid_id'))) {
         $objToReturn->objDatagrid = Datagrid::InstantiateDbRow($objDbRow, $strAliasPrefix . 'datagrid_id__', $strExpandAsArrayNodes);
     }
     // Check for UserAccount Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'user_account_id__user_account_id'))) {
         $objToReturn->objUserAccount = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'user_account_id__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
Exemplo n.º 3
0
 /**
  * Instantiate a DleMailLog from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DleMailLog::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return DleMailLog
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DleMailLog object
     $objToReturn = new DleMailLog();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'mail';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMail = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'hash';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strHash = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_mail_log__';
     }
     return $objToReturn;
 }
Exemplo n.º 4
0
 /**
  * Instantiate a Myassets from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Myassets::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Myassets
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Myassets object
     $objToReturn = new Myassets();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'ASIN', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ASIN'] : $strAliasPrefix . 'ASIN';
     $objToReturn->strAsin = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'DetailPageURL', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'DetailPageURL'] : $strAliasPrefix . 'DetailPageURL';
     $objToReturn->strDetailPageURL = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Title', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Title'] : $strAliasPrefix . 'Title';
     $objToReturn->strTitle = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'ProductGroup', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ProductGroup'] : $strAliasPrefix . 'ProductGroup';
     $objToReturn->strProductGroup = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'ImageURL', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ImageURL'] : $strAliasPrefix . 'ImageURL';
     $objToReturn->strImageURL = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Author', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Author'] : $strAliasPrefix . 'Author';
     $objToReturn->strAuthor = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'NumberOfPages', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'NumberOfPages'] : $strAliasPrefix . 'NumberOfPages';
     $objToReturn->strNumberOfPages = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Publisher', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Publisher'] : $strAliasPrefix . 'Publisher';
     $objToReturn->strPublisher = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'ISBN', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ISBN'] : $strAliasPrefix . 'ISBN';
     $objToReturn->strIsbn = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Actor', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Actor'] : $strAliasPrefix . 'Actor';
     $objToReturn->strActor = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Director', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Director'] : $strAliasPrefix . 'Director';
     $objToReturn->strDirector = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'RunningTime', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'RunningTime'] : $strAliasPrefix . 'RunningTime';
     $objToReturn->strRunningTime = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Artist', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Artist'] : $strAliasPrefix . 'Artist';
     $objToReturn->strArtist = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Label', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Label'] : $strAliasPrefix . 'Label';
     $objToReturn->strLabel = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'NumberOfDiscs', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'NumberOfDiscs'] : $strAliasPrefix . 'NumberOfDiscs';
     $objToReturn->strNumberOfDiscs = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Tracks', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Tracks'] : $strAliasPrefix . 'Tracks';
     $objToReturn->strTracks = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Language', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Language'] : $strAliasPrefix . 'Language';
     $objToReturn->strLanguage = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Genre', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Genre'] : $strAliasPrefix . 'Genre';
     $objToReturn->strGenre = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Owner', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Owner'] : $strAliasPrefix . 'Owner';
     $objToReturn->strOwner = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'myassets__';
     }
     return $objToReturn;
 }
Exemplo n.º 5
0
 /**
  * Instantiate a Receipt from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Receipt::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return Receipt
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Receipt object
     $objToReturn = new Receipt();
     $objToReturn->__blnRestored = true;
     $objToReturn->intReceiptId = $objDbRow->GetColumn($strAliasPrefix . 'receipt_id', 'Integer');
     $objToReturn->intTransactionId = $objDbRow->GetColumn($strAliasPrefix . 'transaction_id', 'Integer');
     $objToReturn->intFromCompanyId = $objDbRow->GetColumn($strAliasPrefix . 'from_company_id', 'Integer');
     $objToReturn->intFromContactId = $objDbRow->GetColumn($strAliasPrefix . 'from_contact_id', 'Integer');
     $objToReturn->intToContactId = $objDbRow->GetColumn($strAliasPrefix . 'to_contact_id', 'Integer');
     $objToReturn->intToAddressId = $objDbRow->GetColumn($strAliasPrefix . 'to_address_id', 'Integer');
     $objToReturn->strReceiptNumber = $objDbRow->GetColumn($strAliasPrefix . 'receipt_number', 'VarChar');
     $objToReturn->dttDueDate = $objDbRow->GetColumn($strAliasPrefix . 'due_date', 'Date');
     $objToReturn->dttReceiptDate = $objDbRow->GetColumn($strAliasPrefix . 'receipt_date', 'Date');
     $objToReturn->blnReceivedFlag = $objDbRow->GetColumn($strAliasPrefix . 'received_flag', 'Bit');
     $objToReturn->intCreatedBy = $objDbRow->GetColumn($strAliasPrefix . 'created_by', 'Integer');
     $objToReturn->dttCreationDate = $objDbRow->GetColumn($strAliasPrefix . 'creation_date', 'DateTime');
     $objToReturn->intModifiedBy = $objDbRow->GetColumn($strAliasPrefix . 'modified_by', 'Integer');
     $objToReturn->strModifiedDate = $objDbRow->GetColumn($strAliasPrefix . 'modified_date', 'VarChar');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'receipt__';
     }
     // Check for Transaction Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'transaction_id__transaction_id'))) {
         $objToReturn->objTransaction = Transaction::InstantiateDbRow($objDbRow, $strAliasPrefix . 'transaction_id__', $strExpandAsArrayNodes);
     }
     // Check for FromCompany Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'from_company_id__company_id'))) {
         $objToReturn->objFromCompany = Company::InstantiateDbRow($objDbRow, $strAliasPrefix . 'from_company_id__', $strExpandAsArrayNodes);
     }
     // Check for FromContact Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'from_contact_id__contact_id'))) {
         $objToReturn->objFromContact = Contact::InstantiateDbRow($objDbRow, $strAliasPrefix . 'from_contact_id__', $strExpandAsArrayNodes);
     }
     // Check for ToContact Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'to_contact_id__contact_id'))) {
         $objToReturn->objToContact = Contact::InstantiateDbRow($objDbRow, $strAliasPrefix . 'to_contact_id__', $strExpandAsArrayNodes);
     }
     // Check for ToAddress Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'to_address_id__address_id'))) {
         $objToReturn->objToAddress = Address::InstantiateDbRow($objDbRow, $strAliasPrefix . 'to_address_id__', $strExpandAsArrayNodes);
     }
     // Check for CreatedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'created_by__user_account_id'))) {
         $objToReturn->objCreatedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'created_by__', $strExpandAsArrayNodes);
     }
     // Check for ModifiedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'modified_by__user_account_id'))) {
         $objToReturn->objModifiedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'modified_by__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
Exemplo n.º 6
0
 /**
  * Instantiate a WpLinks from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this WpLinks::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return WpLinks
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the WpLinks object
     $objToReturn = new WpLinks();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'link_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLinkId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'link_url';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_name';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_image';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkImage = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_target';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkTarget = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_description';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkDescription = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_visible';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkVisible = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_owner';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLinkOwner = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'link_rating';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLinkRating = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'link_updated';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttLinkUpdated = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAlias = $strAliasPrefix . 'link_rel';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkRel = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'link_notes';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkNotes = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'link_rss';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLinkRss = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->LinkId != $objPreviousItem->LinkId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'wp_links__';
     }
     return $objToReturn;
 }
Exemplo n.º 7
0
 /**
  * Instantiate a DleRssinform from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DleRssinform::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return DleRssinform
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DleRssinform object
     $objToReturn = new DleRssinform();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'tag';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTag = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'descr';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strDescr = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'category';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strCategory = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'url';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'template';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTemplate = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'news_max';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intNewsMax = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'tmax';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intTmax = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'dmax';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intDmax = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'approve';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnApprove = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'rss_date_format';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strRssDateFormat = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_rssinform__';
     }
     return $objToReturn;
 }
 /**
  * Instantiate a InventoryTransaction from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this InventoryTransaction::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return InventoryTransaction
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the InventoryTransaction object
     $objToReturn = new InventoryTransaction();
     $objToReturn->__blnRestored = true;
     $objToReturn->intInventoryTransactionId = $objDbRow->GetColumn($strAliasPrefix . 'inventory_transaction_id', 'Integer');
     $objToReturn->intInventoryLocationId = $objDbRow->GetColumn($strAliasPrefix . 'inventory_location_id', 'Integer');
     $objToReturn->intTransactionId = $objDbRow->GetColumn($strAliasPrefix . 'transaction_id', 'Integer');
     $objToReturn->intQuantity = $objDbRow->GetColumn($strAliasPrefix . 'quantity', 'Integer');
     $objToReturn->intSourceLocationId = $objDbRow->GetColumn($strAliasPrefix . 'source_location_id', 'Integer');
     $objToReturn->intDestinationLocationId = $objDbRow->GetColumn($strAliasPrefix . 'destination_location_id', 'Integer');
     $objToReturn->intCreatedBy = $objDbRow->GetColumn($strAliasPrefix . 'created_by', 'Integer');
     $objToReturn->dttCreationDate = $objDbRow->GetColumn($strAliasPrefix . 'creation_date', 'DateTime');
     $objToReturn->intModifiedBy = $objDbRow->GetColumn($strAliasPrefix . 'modified_by', 'Integer');
     $objToReturn->strModifiedDate = $objDbRow->GetColumn($strAliasPrefix . 'modified_date', 'VarChar');
     $objToReturn->intLocalWarehouseStock = $objDbRow->GetColumn($strAliasPrefix . 'local_warehouse_stock', 'Integer');
     $objToReturn->intBadProductsWarehouseStock = $objDbRow->GetColumn($strAliasPrefix . 'bad_products_warehouse_stock', 'Integer');
     $objToReturn->intSampleWarehouseStock = $objDbRow->GetColumn($strAliasPrefix . 'sample_warehouse_stock', 'Integer');
     $objToReturn->intRepairWarehouseStock = $objDbRow->GetColumn($strAliasPrefix . 'repair_warehouse_stock', 'Integer');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'inventory_transaction__';
     }
     // Check for InventoryLocation Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'inventory_location_id__inventory_location_id'))) {
         $objToReturn->objInventoryLocation = InventoryLocation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'inventory_location_id__', $strExpandAsArrayNodes);
     }
     // Check for Transaction Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'transaction_id__transaction_id'))) {
         $objToReturn->objTransaction = Transaction::InstantiateDbRow($objDbRow, $strAliasPrefix . 'transaction_id__', $strExpandAsArrayNodes);
     }
     // Check for SourceLocation Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'source_location_id__location_id'))) {
         $objToReturn->objSourceLocation = Location::InstantiateDbRow($objDbRow, $strAliasPrefix . 'source_location_id__', $strExpandAsArrayNodes);
     }
     // Check for DestinationLocation Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'destination_location_id__location_id'))) {
         $objToReturn->objDestinationLocation = Location::InstantiateDbRow($objDbRow, $strAliasPrefix . 'destination_location_id__', $strExpandAsArrayNodes);
     }
     // Check for CreatedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'created_by__user_account_id'))) {
         $objToReturn->objCreatedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'created_by__', $strExpandAsArrayNodes);
     }
     // Check for ModifiedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'modified_by__user_account_id'))) {
         $objToReturn->objModifiedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'modified_by__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
 /**
  * Instantiate a WordStatusLog from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this WordStatusLog::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return WordStatusLog
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the WordStatusLog object
     $objToReturn = new WordStatusLog();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'word_status_log_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'word_status_log_id'] : $strAliasPrefix . 'word_status_log_id';
     $objToReturn->intWordStatusLogId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'word_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'word_id'] : $strAliasPrefix . 'word_id';
     $objToReturn->intWordId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'status_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'status_type_id'] : $strAliasPrefix . 'status_type_id';
     $objToReturn->intStatusTypeId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'changed_by', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'changed_by'] : $strAliasPrefix . 'changed_by';
     $objToReturn->strChangedBy = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'changed_at', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'changed_at'] : $strAliasPrefix . 'changed_at';
     $objToReturn->dttChangedAt = $objDbRow->GetColumn($strAliasName, 'DateTime');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->WordStatusLogId != $objPreviousItem->WordStatusLogId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'submit_word_word_status_log__';
     }
     // Check for Word Early Binding
     $strAlias = $strAliasPrefix . 'word_id__word_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objWord = Word::InstantiateDbRow($objDbRow, $strAliasPrefix . 'word_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 10
0
 /**
  * Instantiate a WpFormmaker from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this WpFormmaker::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return WpFormmaker
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the WpFormmaker object
     $objToReturn = new WpFormmaker();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'title';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTitle = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'mail';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMail = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'form';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strForm = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'form_front';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strFormFront = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'theme';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intTheme = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'javascript';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strJavascript = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'submit_text';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strSubmitText = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'url';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'submit_text_type';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intSubmitTextType = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'script1';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strScript1 = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'script2';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strScript2 = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'script_user1';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strScriptUser1 = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'script_user2';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strScriptUser2 = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'counter';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intCounter = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'label_order';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strLabelOrder = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'article_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strArticleId = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'pagination';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strPagination = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'show_title';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strShowTitle = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'show_numbers';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strShowNumbers = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'public_key';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strPublicKey = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'private_key';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strPrivateKey = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'recaptcha_theme';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strRecaptchaTheme = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'wp_formmaker__';
     }
     return $objToReturn;
 }
Exemplo n.º 11
0
 /**
  * Instantiate a NarroRolePermission from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this NarroRolePermission::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return NarroRolePermission
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the NarroRolePermission object
     $objToReturn = new NarroRolePermission();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'role_permission_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intRolePermissionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'role_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intRoleId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'permission_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intPermissionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->RolePermissionId != $objPreviousItem->RolePermissionId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'narro_role_permission__';
     }
     // Check for Role Early Binding
     $strAlias = $strAliasPrefix . 'role_id__role_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objRole = NarroRole::InstantiateDbRow($objDbRow, $strAliasPrefix . 'role_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Permission Early Binding
     $strAlias = $strAliasPrefix . 'permission_id__permission_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPermission = NarroPermission::InstantiateDbRow($objDbRow, $strAliasPrefix . 'permission_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
 /**
  * Instantiate a WpWpscstReplies from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this WpWpscstReplies::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return WpWpscstReplies
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the WpWpscstReplies object
     $objToReturn = new WpWpscstReplies();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'primkey';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intPrimkey = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'ticket_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intTicketId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'timestamp';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTimestamp = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'message';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMessage = $objDbRow->GetColumn($strAliasName, 'Blob');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Primkey != $objPreviousItem->Primkey) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'wp_wpscst_replies__';
     }
     return $objToReturn;
 }
Exemplo n.º 13
0
 /**
  * Instantiate a Articlecategory from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Articlecategory::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Articlecategory
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Articlecategory object
     $objToReturn = new Articlecategory();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'ArticleType', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ArticleType'] : $strAliasPrefix . 'ArticleType';
     $objToReturn->strArticleType = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'AmazonCode', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'AmazonCode'] : $strAliasPrefix . 'AmazonCode';
     $objToReturn->strAmazonCode = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Description'] : $strAliasPrefix . 'Description';
     $objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'Blob');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'articlecategory__';
     }
     return $objToReturn;
 }
Exemplo n.º 14
0
 /**
  * Instantiate a DleVote from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DleVote::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return DleVote
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DleVote object
     $objToReturn = new DleVote();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'category';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strCategory = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'vote_num';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intVoteNum = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'date';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strDate = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'title';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTitle = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'body';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strBody = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'approve';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnApprove = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'start';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strStart = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'end';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strEnd = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_vote__';
     }
     return $objToReturn;
 }
Exemplo n.º 15
0
 /**
  * Instantiate a WpPostmeta from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this WpPostmeta::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return WpPostmeta
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the WpPostmeta object
     $objToReturn = new WpPostmeta();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'meta_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intMetaId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'post_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intPostId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'meta_key';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetaKey = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'meta_value';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetaValue = $objDbRow->GetColumn($strAliasName, 'Blob');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->MetaId != $objPreviousItem->MetaId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'wp_postmeta__';
     }
     // Check for Post Early Binding
     $strAlias = $strAliasPrefix . 'post_id__ID';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPost = WpPosts::InstantiateDbRow($objDbRow, $strAliasPrefix . 'post_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 16
0
 /**
  * Instantiate a LoginTicket from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this LoginTicket::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return LoginTicket
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the LoginTicket object
     $objToReturn = new LoginTicket();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';
     $objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'login_ticket__';
     }
     // Check for Person Early Binding
     $strAlias = $strAliasPrefix . 'person_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 17
0
 /**
  * Instantiate a DleStatic from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DleStatic::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return DleStatic
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DleStatic object
     $objToReturn = new DleStatic();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'name';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'descr';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strDescr = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'template';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTemplate = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'allow_br';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnAllowBr = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'allow_template';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnAllowTemplate = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'grouplevel';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strGrouplevel = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'tpl';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTpl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'metadescr';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetadescr = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'metakeys';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetakeys = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'views';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intViews = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'template_folder';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTemplateFolder = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'date';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strDate = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'metatitle';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMetatitle = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'allow_count';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnAllowCount = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'sitemap';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnSitemap = $objDbRow->GetColumn($strAliasName, 'Bit');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_static__';
     }
     return $objToReturn;
 }
Exemplo n.º 18
0
 /**
  * Instantiate a FedexShipment from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this FedexShipment::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return FedexShipment
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the FedexShipment object
     $objToReturn = new FedexShipment();
     $objToReturn->__blnRestored = true;
     $objToReturn->intFedexShipmentId = $objDbRow->GetColumn($strAliasPrefix . 'fedex_shipment_id', 'Integer');
     $objToReturn->intShipmentId = $objDbRow->GetColumn($strAliasPrefix . 'shipment_id', 'Integer');
     $objToReturn->intPackageTypeId = $objDbRow->GetColumn($strAliasPrefix . 'package_type_id', 'Integer');
     $objToReturn->intShippingAccountId = $objDbRow->GetColumn($strAliasPrefix . 'shipping_account_id', 'Integer');
     $objToReturn->intFedexServiceTypeId = $objDbRow->GetColumn($strAliasPrefix . 'fedex_service_type_id', 'Integer');
     $objToReturn->intCurrencyUnitId = $objDbRow->GetColumn($strAliasPrefix . 'currency_unit_id', 'Integer');
     $objToReturn->intWeightUnitId = $objDbRow->GetColumn($strAliasPrefix . 'weight_unit_id', 'Integer');
     $objToReturn->intLengthUnitId = $objDbRow->GetColumn($strAliasPrefix . 'length_unit_id', 'Integer');
     $objToReturn->strToPhone = $objDbRow->GetColumn($strAliasPrefix . 'to_phone', 'VarChar');
     $objToReturn->intPayType = $objDbRow->GetColumn($strAliasPrefix . 'pay_type', 'Integer');
     $objToReturn->strPayerAccountNumber = $objDbRow->GetColumn($strAliasPrefix . 'payer_account_number', 'VarChar');
     $objToReturn->fltPackageWeight = $objDbRow->GetColumn($strAliasPrefix . 'package_weight', 'Float');
     $objToReturn->fltPackageLength = $objDbRow->GetColumn($strAliasPrefix . 'package_length', 'Float');
     $objToReturn->fltPackageWidth = $objDbRow->GetColumn($strAliasPrefix . 'package_width', 'Float');
     $objToReturn->fltPackageHeight = $objDbRow->GetColumn($strAliasPrefix . 'package_height', 'Float');
     $objToReturn->fltDeclaredValue = $objDbRow->GetColumn($strAliasPrefix . 'declared_value', 'Float');
     $objToReturn->strReference = $objDbRow->GetColumn($strAliasPrefix . 'reference', 'Blob');
     $objToReturn->blnSaturdayDeliveryFlag = $objDbRow->GetColumn($strAliasPrefix . 'saturday_delivery_flag', 'Bit');
     $objToReturn->strNotifySenderEmail = $objDbRow->GetColumn($strAliasPrefix . 'notify_sender_email', 'VarChar');
     $objToReturn->blnNotifySenderShipFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_sender_ship_flag', 'Bit');
     $objToReturn->blnNotifySenderExceptionFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_sender_exception_flag', 'Bit');
     $objToReturn->blnNotifySenderDeliveryFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_sender_delivery_flag', 'Bit');
     $objToReturn->strNotifyRecipientEmail = $objDbRow->GetColumn($strAliasPrefix . 'notify_recipient_email', 'VarChar');
     $objToReturn->blnNotifyRecipientShipFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_recipient_ship_flag', 'Bit');
     $objToReturn->blnNotifyRecipientExceptionFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_recipient_exception_flag', 'Bit');
     $objToReturn->blnNotifyRecipientDeliveryFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_recipient_delivery_flag', 'Bit');
     $objToReturn->strNotifyOtherEmail = $objDbRow->GetColumn($strAliasPrefix . 'notify_other_email', 'VarChar');
     $objToReturn->blnNotifyOtherShipFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_other_ship_flag', 'Bit');
     $objToReturn->blnNotifyOtherExceptionFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_other_exception_flag', 'Bit');
     $objToReturn->blnNotifyOtherDeliveryFlag = $objDbRow->GetColumn($strAliasPrefix . 'notify_other_delivery_flag', 'Bit');
     $objToReturn->blnHoldAtLocationFlag = $objDbRow->GetColumn($strAliasPrefix . 'hold_at_location_flag', 'Bit');
     $objToReturn->strHoldAtLocationAddress = $objDbRow->GetColumn($strAliasPrefix . 'hold_at_location_address', 'VarChar');
     $objToReturn->strHoldAtLocationCity = $objDbRow->GetColumn($strAliasPrefix . 'hold_at_location_city', 'VarChar');
     $objToReturn->intHoldAtLocationState = $objDbRow->GetColumn($strAliasPrefix . 'hold_at_location_state', 'Integer');
     $objToReturn->strHoldAtLocationPostalCode = $objDbRow->GetColumn($strAliasPrefix . 'hold_at_location_postal_code', 'VarChar');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'fedex_shipment__';
     }
     // Check for Shipment Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'shipment_id__shipment_id'))) {
         $objToReturn->objShipment = Shipment::InstantiateDbRow($objDbRow, $strAliasPrefix . 'shipment_id__', $strExpandAsArrayNodes);
     }
     // Check for PackageType Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'package_type_id__package_type_id'))) {
         $objToReturn->objPackageType = PackageType::InstantiateDbRow($objDbRow, $strAliasPrefix . 'package_type_id__', $strExpandAsArrayNodes);
     }
     // Check for ShippingAccount Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'shipping_account_id__shipping_account_id'))) {
         $objToReturn->objShippingAccount = ShippingAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'shipping_account_id__', $strExpandAsArrayNodes);
     }
     // Check for FedexServiceType Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'fedex_service_type_id__fedex_service_type_id'))) {
         $objToReturn->objFedexServiceType = FedexServiceType::InstantiateDbRow($objDbRow, $strAliasPrefix . 'fedex_service_type_id__', $strExpandAsArrayNodes);
     }
     // Check for CurrencyUnit Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'currency_unit_id__currency_unit_id'))) {
         $objToReturn->objCurrencyUnit = CurrencyUnit::InstantiateDbRow($objDbRow, $strAliasPrefix . 'currency_unit_id__', $strExpandAsArrayNodes);
     }
     // Check for WeightUnit Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'weight_unit_id__weight_unit_id'))) {
         $objToReturn->objWeightUnit = WeightUnit::InstantiateDbRow($objDbRow, $strAliasPrefix . 'weight_unit_id__', $strExpandAsArrayNodes);
     }
     // Check for LengthUnit Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'length_unit_id__length_unit_id'))) {
         $objToReturn->objLengthUnit = LengthUnit::InstantiateDbRow($objDbRow, $strAliasPrefix . 'length_unit_id__', $strExpandAsArrayNodes);
     }
     // Check for HoldAtLocationStateObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'hold_at_location_state__state_province_id'))) {
         $objToReturn->objHoldAtLocationStateObject = StateProvince::InstantiateDbRow($objDbRow, $strAliasPrefix . 'hold_at_location_state__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
Exemplo n.º 19
0
 /**
  * Instantiate a NarroLog from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this NarroLog::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return NarroLog
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the NarroLog object
     $objToReturn = new NarroLog();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'log_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLogId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'language_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLanguageId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'project_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intProjectId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'message';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strMessage = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'priority';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intPriority = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'date';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->LogId != $objPreviousItem->LogId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'narro_log__';
     }
     // Check for Language Early Binding
     $strAlias = $strAliasPrefix . 'language_id__language_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objLanguage = NarroLanguage::InstantiateDbRow($objDbRow, $strAliasPrefix . 'language_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Project Early Binding
     $strAlias = $strAliasPrefix . 'project_id__project_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objProject = NarroProject::InstantiateDbRow($objDbRow, $strAliasPrefix . 'project_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for User Early Binding
     $strAlias = $strAliasPrefix . 'user_id__user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objUser = NarroUser::InstantiateDbRow($objDbRow, $strAliasPrefix . 'user_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 20
0
 /**
  * Instantiate a Peopledetails from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Peopledetails::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Peopledetails
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Peopledetails object
     $objToReturn = new Peopledetails();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'FullName', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'FullName'] : $strAliasPrefix . 'FullName';
     $objToReturn->strFullName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Address', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Address'] : $strAliasPrefix . 'Address';
     $objToReturn->strAddress = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Phone', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Phone'] : $strAliasPrefix . 'Phone';
     $objToReturn->strPhone = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'Email', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Email'] : $strAliasPrefix . 'Email';
     $objToReturn->strEmail = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'Owner', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'Owner'] : $strAliasPrefix . 'Owner';
     $objToReturn->strOwner = $objDbRow->GetColumn($strAliasName, 'VarChar');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'peopledetails__';
     }
     return $objToReturn;
 }
 /**
  * Instantiate a ShowcaseItem from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this ShowcaseItem::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return ShowcaseItem
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the ShowcaseItem object
     $objToReturn = new ShowcaseItem();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'image_file_type_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'image_file_type_id'] : $strAliasPrefix . 'image_file_type_id';
     $objToReturn->intImageFileTypeId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';
     $objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
     $objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'description', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'description'] : $strAliasPrefix . 'description';
     $objToReturn->strDescription = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'url', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'url'] : $strAliasPrefix . 'url';
     $objToReturn->strUrl = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'live_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'live_flag'] : $strAliasPrefix . 'live_flag';
     $objToReturn->blnLiveFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'showcase_item__';
     }
     // Check for Person Early Binding
     $strAlias = $strAliasPrefix . 'person_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 22
0
 /**
  * Instantiate a DlePm from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DlePm::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return DlePm
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DlePm object
     $objToReturn = new DlePm();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'subj';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strSubj = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'text';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strText = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'user';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUser = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_from';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strUserFrom = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'date';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strDate = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'pm_read';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strPmRead = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'folder';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strFolder = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'reply';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnReply = $objDbRow->GetColumn($strAliasName, 'Bit');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_pm__';
     }
     return $objToReturn;
 }
Exemplo n.º 23
0
 /**
  * Instantiate a DlePoll from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this DlePoll::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return DlePoll
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the DlePoll object
     $objToReturn = new DlePoll();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'news_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intNewsId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'title';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strTitle = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'frage';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strFrage = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAlias = $strAliasPrefix . 'body';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strBody = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAlias = $strAliasPrefix . 'votes';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intVotes = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'multiple';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnMultiple = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'answer';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strAnswer = $objDbRow->GetColumn($strAliasName, 'Blob');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->Id != $objPreviousItem->Id) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'dle_poll__';
     }
     // Check for News Early Binding
     $strAlias = $strAliasPrefix . 'news_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objNews = DlePost::InstantiateDbRow($objDbRow, $strAliasPrefix . 'news_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 24
0
 /**
  * Instantiate a NarroProjectProgress from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this NarroProjectProgress::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return NarroProjectProgress
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the NarroProjectProgress object
     $objToReturn = new NarroProjectProgress();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'project_progress_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intProjectProgressId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'project_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intProjectId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'language_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intLanguageId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'active';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->blnActive = $objDbRow->GetColumn($strAliasName, 'Bit');
     $strAlias = $strAliasPrefix . 'last_modified';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttLastModified = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAlias = $strAliasPrefix . 'total_text_count';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intTotalTextCount = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'fuzzy_text_count';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intFuzzyTextCount = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'approved_text_count';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intApprovedTextCount = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'progress_percent';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intProgressPercent = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'data';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->strData = $objDbRow->GetColumn($strAliasName, 'Blob');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->ProjectProgressId != $objPreviousItem->ProjectProgressId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'narro_project_progress__';
     }
     // Check for Project Early Binding
     $strAlias = $strAliasPrefix . 'project_id__project_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objProject = NarroProject::InstantiateDbRow($objDbRow, $strAliasPrefix . 'project_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Language Early Binding
     $strAlias = $strAliasPrefix . 'language_id__language_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objLanguage = NarroLanguage::InstantiateDbRow($objDbRow, $strAliasPrefix . 'language_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 25
0
 /**
  * Instantiate a NarroSuggestionVote from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this NarroSuggestionVote::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $arrPreviousItem
  * @param string[] $strColumnAliasArray
  * @return NarroSuggestionVote
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the NarroSuggestionVote object
     $objToReturn = new NarroSuggestionVote();
     $objToReturn->__blnRestored = true;
     $strAlias = $strAliasPrefix . 'suggestion_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intSuggestionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intSuggestionId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'context_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intContextId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intContextId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $objToReturn->__intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'vote_value';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->intVoteValue = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAlias = $strAliasPrefix . 'created';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttCreated = $objDbRow->GetColumn($strAliasName, 'DateTime');
     $strAlias = $strAliasPrefix . 'modified';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     $objToReturn->dttModified = $objDbRow->GetColumn($strAliasName, 'DateTime');
     if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
         foreach ($arrPreviousItems as $objPreviousItem) {
             if ($objToReturn->SuggestionId != $objPreviousItem->SuggestionId) {
                 continue;
             }
             if ($objToReturn->ContextId != $objPreviousItem->ContextId) {
                 continue;
             }
             if ($objToReturn->UserId != $objPreviousItem->UserId) {
                 continue;
             }
             // complete match - all primary key columns are the same
             return null;
         }
     }
     // Instantiate Virtual Attributes
     $strVirtualPrefix = $strAliasPrefix . '__';
     $strVirtualPrefixLength = strlen($strVirtualPrefix);
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         if (strncmp($strColumnName, $strVirtualPrefix, $strVirtualPrefixLength) == 0) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'narro_suggestion_vote__';
     }
     // Check for Suggestion Early Binding
     $strAlias = $strAliasPrefix . 'suggestion_id__suggestion_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objSuggestion = NarroSuggestion::InstantiateDbRow($objDbRow, $strAliasPrefix . 'suggestion_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Context Early Binding
     $strAlias = $strAliasPrefix . 'context_id__context_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objContext = NarroContext::InstantiateDbRow($objDbRow, $strAliasPrefix . 'context_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for User Early Binding
     $strAlias = $strAliasPrefix . 'user_id__user_id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objUser = NarroUser::InstantiateDbRow($objDbRow, $strAliasPrefix . 'user_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 26
0
 /**
  * Instantiate a Message from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Message::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Message
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Message object
     $objToReturn = new Message();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'topic_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'topic_id'] : $strAliasPrefix . 'topic_id';
     $objToReturn->intTopicId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'topic_link_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'topic_link_id'] : $strAliasPrefix . 'topic_link_id';
     $objToReturn->intTopicLinkId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';
     $objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'message', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'message'] : $strAliasPrefix . 'message';
     $objToReturn->strMessage = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'compiled_html', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'compiled_html'] : $strAliasPrefix . 'compiled_html';
     $objToReturn->strCompiledHtml = $objDbRow->GetColumn($strAliasName, 'Blob');
     $strAliasName = array_key_exists($strAliasPrefix . 'reply_number', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'reply_number'] : $strAliasPrefix . 'reply_number';
     $objToReturn->intReplyNumber = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'post_date', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'post_date'] : $strAliasPrefix . 'post_date';
     $objToReturn->dttPostDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'message__';
     }
     // Check for Topic Early Binding
     $strAlias = $strAliasPrefix . 'topic_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objTopic = Topic::InstantiateDbRow($objDbRow, $strAliasPrefix . 'topic_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for TopicLink Early Binding
     $strAlias = $strAliasPrefix . 'topic_link_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objTopicLink = TopicLink::InstantiateDbRow($objDbRow, $strAliasPrefix . 'topic_link_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     // Check for Person Early Binding
     $strAlias = $strAliasPrefix . 'person_id__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 27
0
 /**
  * Instantiate a Articlemusictracks from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Articlemusictracks::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Articlemusictracks
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Articlemusictracks object
     $objToReturn = new Articlemusictracks();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'ReferenceId', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'ReferenceId'] : $strAliasPrefix . 'ReferenceId';
     $objToReturn->intReferenceId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'DiscNumber', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'DiscNumber'] : $strAliasPrefix . 'DiscNumber';
     $objToReturn->strDiscNumber = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'TrackNumber', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'TrackNumber'] : $strAliasPrefix . 'TrackNumber';
     $objToReturn->strTrackNumber = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'TrackTitle', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'TrackTitle'] : $strAliasPrefix . 'TrackTitle';
     $objToReturn->strTrackTitle = $objDbRow->GetColumn($strAliasName, 'Blob');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'articlemusictracks__';
     }
     // Check for ReferenceIdObject Early Binding
     $strAlias = $strAliasPrefix . 'ReferenceId__id';
     $strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
     if (!is_null($objDbRow->GetColumn($strAliasName))) {
         $objToReturn->objReferenceIdObject = Articlemusic::InstantiateDbRow($objDbRow, $strAliasPrefix . 'ReferenceId__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
     }
     return $objToReturn;
 }
Exemplo n.º 28
0
 /**
  * Instantiate a Attachment from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Attachment::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return Attachment
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Attachment object
     $objToReturn = new Attachment();
     $objToReturn->__blnRestored = true;
     $objToReturn->intAttachmentId = $objDbRow->GetColumn($strAliasPrefix . 'attachment_id', 'Integer');
     $objToReturn->intEntityQtypeId = $objDbRow->GetColumn($strAliasPrefix . 'entity_qtype_id', 'Integer');
     $objToReturn->intEntityId = $objDbRow->GetColumn($strAliasPrefix . 'entity_id', 'Integer');
     $objToReturn->strFilename = $objDbRow->GetColumn($strAliasPrefix . 'filename', 'VarChar');
     $objToReturn->strTmpFilename = $objDbRow->GetColumn($strAliasPrefix . 'tmp_filename', 'VarChar');
     $objToReturn->strFileType = $objDbRow->GetColumn($strAliasPrefix . 'file_type', 'VarChar');
     $objToReturn->strPath = $objDbRow->GetColumn($strAliasPrefix . 'path', 'VarChar');
     $objToReturn->intSize = $objDbRow->GetColumn($strAliasPrefix . 'SIZE', 'Integer');
     $objToReturn->intCreatedBy = $objDbRow->GetColumn($strAliasPrefix . 'created_by', 'Integer');
     $objToReturn->dttCreationDate = $objDbRow->GetColumn($strAliasPrefix . 'creation_date', 'DateTime');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'attachment__';
     }
     // Check for CreatedByObject Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'created_by__user_account_id'))) {
         $objToReturn->objCreatedByObject = UserAccount::InstantiateDbRow($objDbRow, $strAliasPrefix . 'created_by__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
Exemplo n.º 29
0
 /**
  * Instantiate a Parameter from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Parameter::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @return Parameter
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null)
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Parameter object
     $objToReturn = new Parameter();
     $objToReturn->__blnRestored = true;
     $objToReturn->intId = $objDbRow->GetColumn($strAliasPrefix . 'id', 'Integer');
     $objToReturn->intOperationId = $objDbRow->GetColumn($strAliasPrefix . 'operation_id', 'Integer');
     $objToReturn->intOrderNumber = $objDbRow->GetColumn($strAliasPrefix . 'order_number', 'Integer');
     $objToReturn->intVariableId = $objDbRow->GetColumn($strAliasPrefix . 'variable_id', 'Integer');
     $objToReturn->blnReferenceFlag = $objDbRow->GetColumn($strAliasPrefix . 'reference_flag', 'Bit');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'parameter__';
     }
     // Check for Operation Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'operation_id__id'))) {
         $objToReturn->objOperation = Operation::InstantiateDbRow($objDbRow, $strAliasPrefix . 'operation_id__', $strExpandAsArrayNodes);
     }
     // Check for Variable Early Binding
     if (!is_null($objDbRow->GetColumn($strAliasPrefix . 'variable_id__id'))) {
         $objToReturn->objVariable = Variable::InstantiateDbRow($objDbRow, $strAliasPrefix . 'variable_id__', $strExpandAsArrayNodes);
     }
     return $objToReturn;
 }
Exemplo n.º 30
0
 /**
  * Instantiate a Registry from a Database Row.
  * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
  * is calling this Registry::InstantiateDbRow in order to perform
  * early binding on referenced objects.
  * @param DatabaseRowBase $objDbRow
  * @param string $strAliasPrefix
  * @param string $strExpandAsArrayNodes
  * @param QBaseClass $objPreviousItem
  * @param string[] $strColumnAliasArray
  * @return Registry
  */
 public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array())
 {
     // If blank row, return null
     if (!$objDbRow) {
         return null;
     }
     // Create a new instance of the Registry object
     $objToReturn = new Registry();
     $objToReturn->__blnRestored = true;
     $strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
     $objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
     $strAliasName = array_key_exists($strAliasPrefix . 'name', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'name'] : $strAliasPrefix . 'name';
     $objToReturn->strName = $objDbRow->GetColumn($strAliasName, 'VarChar');
     $strAliasName = array_key_exists($strAliasPrefix . 'value', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'value'] : $strAliasPrefix . 'value';
     $objToReturn->strValue = $objDbRow->GetColumn($strAliasName, 'Blob');
     // Instantiate Virtual Attributes
     foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
         $strVirtualPrefix = $strAliasPrefix . '__';
         $strVirtualPrefixLength = strlen($strVirtualPrefix);
         if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix) {
             $objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
         }
     }
     // Prepare to Check for Early/Virtual Binding
     if (!$strAliasPrefix) {
         $strAliasPrefix = 'registry__';
     }
     return $objToReturn;
 }