/**
* 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 `parameter` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`id` AS `%s__%s__id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`operation_id` AS `%s__%s__operation_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`order_number` AS `%s__%s__order_number`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`variable_id` AS `%s__%s__variable_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`reference_flag` AS `%s__%s__reference_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
case 'operation_id':
try {
Operation::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'variable_id':
try {
Variable::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));
}
}
}
}
/**
* 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 `transaction_type` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`transaction_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`transaction_type_id` AS `%s__%s__transaction_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`short_description` AS `%s__%s__short_description`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`asset_flag` AS `%s__%s__asset_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`inventory_flag` AS `%s__%s__inventory_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
default:
throw new QCallerException(sprintf('Unknown Object to Expand in %s: %s', $strParentAlias, $strKey));
}
}
}
}
/**
* 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 `datagrid_column_preference` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`datagrid_column_preference_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`datagrid_column_preference_id` AS `%s__%s__datagrid_column_preference_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`datagrid_id` AS `%s__%s__datagrid_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`column_name` AS `%s__%s__column_name`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`user_account_id` AS `%s__%s__user_account_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`display_flag` AS `%s__%s__display_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
case 'datagrid_id':
try {
Datagrid::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'user_account_id':
try {
UserAccount::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));
}
}
}
}
/**
* 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 `directory_token` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`id` AS `%s__%s__id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`token` AS `%s__%s__token`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`path` AS `%s__%s__path`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`core_flag` AS `%s__%s__core_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`relative_flag` AS `%s__%s__relative_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
default:
throw new QCallerException(sprintf('Unknown Object to Expand in %s: %s', $strParentAlias, $strKey));
}
}
}
}
/**
* 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 `audit_scan` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`audit_scan_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`audit_scan_id` AS `%s__%s__audit_scan_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`audit_id` AS `%s__%s__audit_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`location_id` AS `%s__%s__location_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`entity_id` AS `%s__%s__entity_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`COUNT` AS `%s__%s__COUNT`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`system_count` AS `%s__%s__system_count`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
case 'audit_id':
try {
Audit::ExpandQuery($strParentAlias, $strKey, $objValue, $objQueryExpansion);
break;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'location_id':
try {
Location::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));
}
}
}
}
/**
* 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 `person` AS `%s__%s` ON `%s`.`%s` = `%s__%s`.`id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`id` AS `%s__%s__id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`person_type_id` AS `%s__%s__person_type_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`username` AS `%s__%s__username`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`password` AS `%s__%s__password`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`first_name` AS `%s__%s__first_name`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`last_name` AS `%s__%s__last_name`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`email` AS `%s__%s__email`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`display_real_name_flag` AS `%s__%s__display_real_name_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`display_email_flag` AS `%s__%s__display_email_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`opt_in_flag` AS `%s__%s__opt_in_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`donated_flag` AS `%s__%s__donated_flag`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`location` AS `%s__%s__location`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`country_id` AS `%s__%s__country_id`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`url` AS `%s__%s__url`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$objQueryExpansion->AddSelectItem(sprintf('`%s__%s`.`registration_date` AS `%s__%s__registration_date`', $strParentAlias, $strAlias, $strParentAlias, $strAlias));
$strParentAlias = $strParentAlias . '__' . $strAlias;
}
if (is_array($objExpansionMap)) {
foreach ($objExpansionMap as $strKey => $objValue) {
switch ($strKey) {
default:
throw new QCallerException(sprintf('Unknown Object to Expand in %s: %s', $strParentAlias, $strKey));
}
}
}
}
请发表评论