Good morning,
my repository looks like this:
public function findbyBeitrag($BS) {
$query = $this->createQuery();
$query->matching(
$query->equals('name', $BS)
);
return $query->execute();
}
My controller looks like that:
public function findbyBeitragAction() {
$BS = '1';
$ergebnis = $this->beitragssatzRepository->findByBeitrag($BS);
return . $ergebnis . '!';
}
The database looks like that:
name beitragssatz
1 15,00
2 30,00
3 40,00
As result of the query I want to get "15,00". What do I have to add to the function in the repository to get as result of my query only the 15,00? I get the error message "Result could not be converted to string".
Thank you very much.
Inject Doctrine's Entity Manger in the repository:
Then with the following :
I got an output as array. Then with