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;
    }