[TYPO3-mvc] calling the findAll in another Action
Chris Wolff - AERTiCKET AG
cwolff at aer.de
Fri Dec 5 14:11:35 CET 2014
Maybe its just a misspelling in the mal but i think it should be findByPay (uppercase P).
Regards chris
-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von RAKIBI Anass
Gesendet: Freitag, 5. Dezember 2014 13:48
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] calling the findAll in another Action
Hello ,
I have created an extension with 2 Models Country and Company with a 1--* relation . In the list view of the Country Controller , all the countries are listed (into a select ) , On a change event I want to list only Companies that belong to that Country using Ajax ...
The Ajax call is already designed and works fine , it calls an action in the Country controller , this action is designed to look for all companies where country_id = the id passed in the ajax call . here is how this action looks like :
public function getMyCompanysAction()
{
$argument = $this->request->getArguments('id');
$company = $this->entrepriseRepository->findBypays(2);// Repository of Company Model injected
$company->att = 'val';
$company->nom = $company->nom;
$result = (array) $company;
return json_encode($result);
}
the $this->entrepriseRepository->findBypays(2); seems to return always null here , though is returns the exact entry If I use it in ListAction this way : $this->view->assign('lists', $this->entrepriseRepository->findBypays(2));
What could be the Problem ?
Best Regards
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list