*/ trait FilterTrait { public function getFieldPropertySnake(string $fieldName): string { return str_replace('.', '_', $fieldName); } public function getFieldPropertyBase(string $fieldName): string { return str_replace('_', '.', $fieldName); } public function isRelationField(string $fieldName, string $needle = "."): bool { return strpos($fieldName, $needle) !== false; } public function getFieldPropertyWithoutRelation(string $fieldName, string $needle = '.'): string { return substr($fieldName, strpos($fieldName, $needle) + 1); } public function getFieldPropertyRelationAlias(string $fieldName, string $needle = '.'): string { return substr($fieldName, 0, strpos($fieldName, $needle)); } public function getFieldProperty(FieldDto $fieldDto) { $property = $fieldDto->getProperty(); //TODO pas forcément utile, à discuter // if ($fieldDto->getCustomOption('filter_on')) { // $property = $property . '.' . $fieldDto->getCustomOption('filter_on'); // } return $property; } }