QQReverseReferenceNode::GetColumnAlias PHP Метод

GetColumnAlias() публичный Метод

public GetColumnAlias ( QQueryBuilder $objBuilder, $blnExpandSelection = false, QQCondition $objJoinCondition = null )
$objBuilder QQueryBuilder
$objJoinCondition QQCondition
    public function GetColumnAlias(QQueryBuilder $objBuilder, $blnExpandSelection = false, QQCondition $objJoinCondition = null)
    {
        // Make sure our Root Tables Match
        if ($this->_RootTableName != $objBuilder->RootTableName) {
            throw new QCallerException('Cannot use QQNode for "' . $this->_RootTableName . '" when querying against the "' . $objBuilder->RootTableName . '" table', 3);
        }
        // Pull the Begin and End Escape Identifiers from the Database Adapter
        $strBegin = $objBuilder->Database->EscapeIdentifierBegin;
        $strEnd = $objBuilder->Database->EscapeIdentifierEnd;
        // If we are a standard QQNode at the top level column, simply return the column name
        if (get_class($this) == 'QQNode' && is_null($this->objParentNode->_Type)) {
            /*				return sprintf('%s%s%s.%s%s%s',
            					$strBegin, $this->objParentNode->_Name, $strEnd,
            					$strBegin, $this->strName, $strEnd);*/
            return;
        } else {
            // Use the Helper to Iterate Through the Parent Chain and get the Parent Alias
            $strParentAlias = $this->objParentNode->GetColumnAliasHelper($objBuilder, $strBegin, $strEnd, $blnExpandSelection);
            if ($this->strTableName) {
                // Next, Join the Appropriate Table
                $objBuilder->AddJoinItem($this->strTableName, $strParentAlias . '__' . $this->strName, $strParentAlias, $this->objParentNode->_PrimaryKey, $this->strForeignKey, $objJoinCondition);
                if ($blnExpandSelection) {
                    call_user_func(array($this->strClassName, 'GetSelectFields'), $objBuilder, $strParentAlias . '__' . $this->strName);
                }
            }
            // Finally, return the final column alias name (Parent Prefix with Current Node Name)
            /*				return sprintf('%s%s%s.%s%s%s',
            					$strBegin, $strParentAlias, $strEnd,
            					$strBegin, $this->strName, $strEnd);*/
            return;
        }
    }