application/Espo/Core/Utils/Database/Orm/Base.php
protected function getForeignField($name, $entityName)
    {
        $foreignField = $this->getMetadata()->get('entityDefs.'.$entityName.'.fields.'.$name);

        if ($foreignField['type'] != 'varchar') {
            if ($foreignField['type'] == 'personName') {
                return array('first' . ucfirst($name), ' ', 'last' . ucfirst($name));
            }
        }

        return $name;
    }
protected function getForeignField($name, $entityName)
    {
        $foreignField = $this->getMetadata()->get('entityDefs.'.$entityName.'.fields.'.$name);

        if ($foreignField['type'] != 'varchar') {
            if ($foreignField['type'] == 'personName') {
                return array('first' . ucfirst($name), ' ', 'last' . ucfirst($name));
            }
        }

        return $name;
    }
protected function getForeignField ( $ name , $ entityName ) { $ foreignField = $ this -> getMetadata ( ) -> get ( 'entityDefs.' . $ entityName . '.fields.' . $ name ) ; if ( $ foreignField [ 'type' ] != 'varchar' ) { if ( $ foreignField [ 'type' ] == 'personName' ) { return array ( 'first' . ucfirst ( $ name ) , ' ' , 'last' . ucfirst ( $ name ) ) ; } } return $ name ; }
Get Foreign field

@param  string $name
@param  string $entityName
@return string
Get Foreign field