本文整理汇总了PHP中Shipment::ExpandQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Shipment::ExpandQuery方法的具体用法?PHP Shipment::ExpandQuery怎么用?PHP Shipment::ExpandQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shipment
的用法示例。
在下文中一共展示了Shipment::ExpandQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExpandQuery
/**
* Internally called method to assist with early binding of objects
* on load methods. Can only early-bind references that this class owns in the database.
* @param string $strParentAlias the alias of the parent (if any)
* @param string $strAlias the alias of this object
* @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding
* @param QueryExpansion an already instantiated QueryExpansion object (used as a utility object to assist with object expansion)
*/
public static function ExpandQuery($strParentAlias, $strAlias, $objExpansionMap, QQueryExpansion $objQueryExpansion)
{
if ($strAlias) {
$objQueryExpansion->AddFromItem(sprintf('LEFT JOIN `fedex_shipment` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`fedex_shipment_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`fedex_shipment_id` AS `%s__%s__fedex_shipment_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`shipment_id` AS `%s__%s__shipment_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`package_type_id` AS `%s__%s__package_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`shipping_account_id` AS `%s__%s__shipping_account_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`fedex_service_type_id` AS `%s__%s__fedex_service_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`currency_unit_id` AS `%s__%s__currency_unit_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`weight_unit_id` AS `%s__%s__weight_unit_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`length_unit_id` AS `%s__%s__length_unit_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`to_phone` AS `%s__%s__to_phone`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`pay_type` AS `%s__%s__pay_type`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`payer_account_number` AS `%s__%s__payer_account_number`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`package_weight` AS `%s__%s__package_weight`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`package_length` AS `%s__%s__package_length`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`package_width` AS `%s__%s__package_width`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`package_height` AS `%s__%s__package_height`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`declared_value` AS `%s__%s__declared_value`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`reference` AS `%s__%s__reference`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`saturday_delivery_flag` AS `%s__%s__saturday_delivery_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_sender_email` AS `%s__%s__notify_sender_email`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_sender_ship_flag` AS `%s__%s__notify_sender_ship_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_sender_exception_flag` AS `%s__%s__notify_sender_exception_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_sender_delivery_flag` AS `%s__%s__notify_sender_delivery_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_recipient_email` AS `%s__%s__notify_recipient_email`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_recipient_ship_flag` AS `%s__%s__notify_recipient_ship_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_recipient_exception_flag` AS `%s__%s__notify_recipient_exception_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_recipient_delivery_flag` AS `%s__%s__notify_recipient_delivery_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_other_email` AS `%s__%s__notify_other_email`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_other_ship_flag` AS `%s__%s__notify_other_ship_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_other_exception_flag` AS `%s__%s__notify_other_exception_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`notify_other_delivery_flag` AS `%s__%s__notify_other_delivery_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`hold_at_location_flag` AS `%s__%s__hold_at_location_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`hold_at_location_address` AS `%s__%s__hold_at_location_address`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`hold_at_location_city` AS `%s__%s__hold_at_location_city`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`hold_at_location_state` AS `%s__%s__hold_at_location_state`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`hold_at_location_postal_code` AS `%s__%s__hold_at_location_postal_code`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
case 'shipment_id':
try {
Shipment::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'package_type_id':
try {
PackageType::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'shipping_account_id':
try {
ShippingAccount::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'fedex_service_type_id':
try {
FedexServiceType::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'currency_unit_id':
try {
CurrencyUnit::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'weight_unit_id':
try {
WeightUnit::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
//.........这里部分代码省略.........
示例2: LoadArrayBySearchHelper
/**
* Load an array of Shipment objects
* by To Company, To Contact, From Company, From Contact, Shipment Number, Asset Code, Inventory Code, Tracking Number, or Status
* using the shipment_custom_field_helper table
*
* @param string $strToCompany
* @param string $strToContact
* @param string $strFromCompany
* @param string $strFromContact
* @param string $strShipmentNumber
* @param string $strAssetCode
* @param string $strInventoryModelCode
* @param int $intStatus
* @param string $strTrackingNumber
* @param int $intCourierId
* @param string $strNote
* @param string $strDateModified
* @param string $strDateModifiedFirst
* @param string $strDateModifiedLast
* @param string $strOrderBy
* @param string $strLimit
* @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding
* @return Shipment[]
*/
public static function LoadArrayBySearchHelper($strToCompany = null, $strToContact = null, $strFromCompany = null, $strFromContact = null, $strShipmentNumber = null, $strAssetCode = null, $strInventoryModelCode = null, $intStatus = null, $strTrackingNumber = null, $intCourierId = null, $strNote = null, $strShipmentDate = null, $arrCustomFields = null, $strDateModified = null, $strDateModifiedFirst = null, $strDateModifiedLast = null, $blnAttachment = null, $strOrderBy = null, $strLimit = null, $objExpansionMap = null)
{
Shipment::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase);
// Setup QueryExpansion
$objQueryExpansion = new QQueryExpansion();
if ($objExpansionMap) {
try {
Shipment::ExpandQuery('shipment', null, $objExpansionMap, $objQueryExpansion);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
$arrSearchSql = Shipment::GenerateSearchSql($strToCompany, $strToContact, $strFromCompany, $strFromContact, $strShipmentNumber, $strAssetCode, $strInventoryModelCode, $intStatus, $strTrackingNumber, $intCourierId, $strNote, $strShipmentDate, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment);
$arrAttachmentSql = Attachment::GenerateSql(EntityQtype::Shipment);
$arrCustomFieldSql = CustomField::GenerateHelperSql(EntityQtype::Shipment);
$strQuery = sprintf('
SELECT
%s
DISTINCT
`shipment`.`shipment_id` AS `shipment_id`,
`shipment`.`shipment_number` AS `shipment_number`,
`shipment`.`to_contact_id` AS `to_contact_id`,
`shipment`.`from_company_id` AS `from_company_id`,
`shipment`.`from_contact_id` AS `from_contact_id`,
`shipment`.`transaction_id` AS `transaction_id`,
`shipment`.`ship_date` AS `ship_date`,
`shipment`.`from_address_id` AS `from_address_id`,
`shipment`.`to_company_id` AS `to_company_id`,
`shipment`.`to_address_id` AS `to_address_id`,
`shipment`.`courier_id` AS `courier_id`,
`shipment`.`shipped_flag` AS `shipped_flag`,
`shipment`.`tracking_number` AS `tracking_number`,
`shipment`.`created_by` AS `created_by`,
`shipment`.`creation_date` AS `creation_date`,
`shipment`.`modified_by` AS `modified_by`,
`shipment`.`modified_date` AS `modified_date`
%s
%s
%s
FROM
`shipment` AS `shipment`
%s
%s
%s
%s
%s
WHERE
1=1
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
%s
', $strLimitPrefix, $objQueryExpansion->GetSelectSql(",\n\t\t\t\t\t", ",\n\t\t\t\t\t"), $arrCustomFieldSql['strSelect'], $arrAttachmentSql['strSelect'], $objQueryExpansion->GetFromSql("", "\n\t\t\t\t\t"), $arrCustomFieldSql['strFrom'], $arrAttachmentSql['strFrom'], $arrSearchSql['strAssetCodeFromSql'], $arrSearchSql['strInventoryModelCodeFromSql'], $arrSearchSql['strToCompanySql'], $arrSearchSql['strToContactSql'], $arrSearchSql['strFromCompanySql'], $arrSearchSql['strFromContactSql'], $arrSearchSql['strShipmentNumberSql'], $arrSearchSql['strAssetCodeSql'], $arrSearchSql['strInventoryModelCodeSql'], $arrSearchSql['strStatusSql'], $arrSearchSql['strTrackingNumberSql'], $arrSearchSql['strCourierSql'], $arrSearchSql['strNoteSql'], $arrSearchSql['strShipmentDateSql'], $arrSearchSql['strCustomFieldsSql'], $arrSearchSql['strDateModifiedSql'], $arrSearchSql['strAttachmentSql'], $arrSearchSql['strAuthorizationSql'], $arrAttachmentSql['strGroupBy'], $strOrderBy, $strLimitSuffix);
$objDbResult = $objDatabase->Query($strQuery);
return Shipment::InstantiateDbResult($objDbResult);
}
示例3: ExpandQuery
/**
* Internally called method to assist with early binding of objects
* on load methods. Can only early-bind references that this class owns in the database.
* @param string $strParentAlias the alias of the parent (if any)
* @param string $strAlias the alias of this object
* @param array $objExpansionMap map of referenced columns to be immediately expanded via early-binding
* @param QueryExpansion an already instantiated QueryExpansion object (used as a utility object to assist with object expansion)
*/
public static function ExpandQuery($strParentAlias, $strAlias, $objExpansionMap, QQueryExpansion $objQueryExpansion)
{
if ($strAlias) {
$objQueryExpansion->AddFromItem(sprintf('LEFT JOIN `shipment_custom_field_helper` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`shipment_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`shipment_id` AS `%s__%s__shipment_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
case 'shipment_id':
try {
Shipment::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
default:
throw new QCallerException(sprintf('Unknown Object to Expand in %s: %s', $strParentAlias, $strKey));
}
}
}
}