lithium\data\Source::relationFieldName()
Returns the field name of a relation name (underscore).
Parameters
-
string
The
type of the relation.
-
string
The
name of the relation.
Returns
stringSource
public function relationFieldName($type, $name) {
$fieldName = Inflector::underscore($name);
if (preg_match('/Many$/', $type)) {
$fieldName = Inflector::pluralize($fieldName);
} else {
$fieldName = Inflector::singularize($fieldName);
}
return $fieldName;
}