public function getReferencedField($objectName, $fieldName, array & $excludedFieldNameParts = array(), $objectReferencesOnly = true)
    {
        $foundFieldName = null;
        $fieldNameParts = explode('_', $fieldName);
        $excludedFieldNameParts = array();
        $initial = false;
        while (count($fieldNameParts) > 0) {
            if ($initial === true) {
                array_unshift($excludedFieldNameParts, array_pop($fieldNameParts));
            }

            $fieldName = implode("_", $fieldNameParts);
            if ($this->hasField($objectName, $fieldName)) {
                $foundFieldName = $fieldName;
                break;
            }

            $initial = true;
        }

        if (!empty($foundFieldName) && is_array($fieldConfiguration = $this->getField($objectName, $foundFieldName)) && ($objectReferencesOnly === false || $this->isObjectReference($fieldConfiguration['datatype']))) {
            return $fieldConfiguration;
        }
    }
public function getReferencedField($objectName, $fieldName, array & $excludedFieldNameParts = array(), $objectReferencesOnly = true)
    {
        $foundFieldName = null;
        $fieldNameParts = explode('_', $fieldName);
        $excludedFieldNameParts = array();
        $initial = false;
        while (count($fieldNameParts) > 0) {
            if ($initial === true) {
                array_unshift($excludedFieldNameParts, array_pop($fieldNameParts));
            }

            $fieldName = implode("_", $fieldNameParts);
            if ($this->hasField($objectName, $fieldName)) {
                $foundFieldName = $fieldName;
                break;
            }

            $initial = true;
        }

        if (!empty($foundFieldName) && is_array($fieldConfiguration = $this->getField($objectName, $foundFieldName)) && ($objectReferencesOnly === false || $this->isObjectReference($fieldConfiguration['datatype']))) {
            return $fieldConfiguration;
        }
    }
public function getReferencedField ( $ objectName , $ fieldName , array & $ excludedFieldNameParts = array ( ) , $ objectReferencesOnly = true ) { $ foundFieldName = null ; $ fieldNameParts = explode ( '_' , $ fieldName ) ; $ excludedFieldNameParts = array ( ) ; $ initial = false ; while ( count ( $ fieldNameParts ) > 0 ) { if ( $ initial === true ) { array_unshift ( $ excludedFieldNameParts , array_pop ( $ fieldNameParts ) ) ; } $ fieldName = implode ( "_" , $ fieldNameParts ) ; if ( $ this -> hasField ( $ objectName , $ fieldName ) ) { $ foundFieldName = $ fieldName ; break ; } $ initial = true ; } if ( ! empty ( $ foundFieldName ) && is_array ( $ fieldConfiguration = $ this -> getField ( $ objectName , $ foundFieldName ) ) && ( $ objectReferencesOnly === false || $ this -> isObjectReference ( $ fieldConfiguration [ 'datatype' ] ) ) ) { return $ fieldConfiguration ; } }
Returns the field reference of the specified object.
The returned excluded field name parts can be used to retrieve the field for the referenced object.

@param string $objectName
@param string $fieldName
@param array  $excludedFieldNameParts
@param bool   $objectReferencesOnly

@return array|null
Returns the field reference of the specified object . The returned excluded field name parts can be used to retrieve the field for the referenced object .