Back to AssociationExtensionHelper class

Method getTypeFieldName

public string
getTypeFieldName
(mixed $typeName, mixed $fieldName)
Get a table field name for a type
Parameters
  • string $typeName The item type
  • string $fieldName The item type
Returns
  • string
Since
  • 3.7.0

Method getTypeFieldName - Source code

/**
 * Get a table field name for a type
 *
 * @param   string  $typeName   The item type
 * @param   string  $fieldName  The item type
 *
 * @return  string
 *
 * @since   3.7.0
 */
public function getTypeFieldName($typeName, $fieldName)
{
    $fields = $this->getTypeFields($typeName);
    if (!\array_key_exists($fieldName, $fields)) {
        return '';
    }
    $tmp = $fields[$fieldName];
    $pos = strpos($tmp, '.');
    if ($pos === false) {
        return $tmp;
    }
    return substr($tmp, $pos + 1);
}