本文整理汇总了PHP中QQ::CustomJoin方法的典型用法代码示例。如果您正苦于以下问题:PHP QQ::CustomJoin方法的具体用法?PHP QQ::CustomJoin怎么用?PHP QQ::CustomJoin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQ
的用法示例。
在下文中一共展示了QQ::CustomJoin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetQqNodeForAttributeNode
protected function GetQqNodeForAttributeNode(QQCondition &$objQqCondition = null, &$objQqClauses = null, $strValue)
{
// Get the Attribute object we are trying to query against
$objAttribute = Attribute::Load($this->NodeDetail);
$strAttributeValueTableAlias = 'av' . self::$intJoinCount++;
$objQqClauses[] = QQ::CustomJoin('attribute_value', $strAttributeValueTableAlias, sprintf('%s%s%s.%sperson_id%s = %st0%s.%sid%s AND %s%s%s.%sattribute_id%s = %s', self::GetDatabase()->EscapeIdentifierBegin, $strAttributeValueTableAlias, self::GetDatabase()->EscapeIdentifierEnd, self::GetDatabase()->EscapeIdentifierBegin, self::GetDatabase()->EscapeIdentifierEnd, self::GetDatabase()->EscapeIdentifierBegin, self::GetDatabase()->EscapeIdentifierEnd, self::GetDatabase()->EscapeIdentifierBegin, self::GetDatabase()->EscapeIdentifierEnd, self::GetDatabase()->EscapeIdentifierBegin, $strAttributeValueTableAlias, self::GetDatabase()->EscapeIdentifierEnd, self::GetDatabase()->EscapeIdentifierBegin, self::GetDatabase()->EscapeIdentifierEnd, $objAttribute->Id));
// What is the ATTRIBUTE's type? Figure out the Custom QQ Node based on that
switch ($objAttribute->AttributeDataTypeId) {
case AttributeDataType::Checkbox:
$objQqNode = QQ::CustomNode(sprintf('%s.boolean_value', $strAttributeValueTableAlias));
break;
case AttributeDataType::Date:
$objQqNode = QQ::CustomNode(sprintf('%s.date_value', $strAttributeValueTableAlias));
break;
case AttributeDataType::DateTime:
$objQqNode = QQ::CustomNode(sprintf('%s.datetime_value', $strAttributeValueTableAlias));
break;
case AttributeDataType::Text:
$objQqNode = QQ::CustomNode(sprintf('%s.text_value', $strAttributeValueTableAlias));
break;
case AttributeDataType::ImmutableSingleDropdown:
case AttributeDataType::MutableSingleDropdown:
$objQqNode = QQ::CustomNode(sprintf('%s.single_attribute_option_id', $strAttributeValueTableAlias));
break;
case AttributeDataType::ImmutableMultipleDropdown:
case AttributeDataType::MutableMultipleDropdown:
$strAttributeOptionTableAlias = 'avmaoa' . self::$intJoinCount++;
$objQqClauses[] = QQ::CustomJoin('attributevalue_multipleattributeoption_assn', $strAttributeOptionTableAlias, sprintf("%s.attribute_value_id = %s.id AND %s.attribute_option_id = '%s'", $strAttributeOptionTableAlias, $strAttributeValueTableAlias, $strAttributeOptionTableAlias, $strValue));
$objQqNode = QQ::CustomNode(sprintf('%s.attribute_option_id', $strAttributeOptionTableAlias));
break;
default:
throw new Exception('No Support for Attribute Data Type Id: ' . $objAttribute->AttributeDataTypeId);
}
return $objQqNode;
}