[TYPO3-mvc] searching backward in model

Johannes C. Schulz - EnzephaloN IT-Solutions info at enzephalon.de
Tue Feb 7 08:39:00 CET 2012


Again...
The right way should be:
list-view:
<f:for each="{accreditation.persons}" as="person" iteration="evenorodd">
<f:render partial="Accreditation/Persons"
arguments="{oneperson:person,pdfpage:pdfpage,accreditation:accreditation}"
/>
partial:
<f:link.action action="makepdf"
arguments="{person:oneperson,accreditation:accreditation}"
pageUid="{pdfpage}" target="_blank">
controller-action:
public function makepdfAction(Tx_PsoaAccredit_Domain_Model_Person
$person,Tx_PsoaAccredit_Domain_Model_Accreditation $accreditation) {
But extbase says:
#1: PHP Catchable Fatal Error: Argument 2 passed to
Tx_PsoaAccredit_Controller_AccreditationController::makepdfAction() must be
an instance of Tx_PsoaAccredit_Domain_Model_Accreditation, none given in
F:\Kunden\xampp\htdocs\psoa\typo3conf\ext\psoa_accredit\Classes\Controller\A
ccreditationController.php line 197

I don't understand why the accreditation-object is empty, if it is submitted
to the action! In list and in partial its not empty!
Hope someone can help!
Johannes

-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
[mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
Johannes C. Schulz - EnzephaloN IT-Solutions
Gesendet: Dienstag, 7. Februar 2012 07:31
An: 'TYPO3 v4 MVC project'
Betreff: [TYPO3-mvc] searching backward in model

Hello list!

I have a big problem, getting values of a parent-object.
I have a model called accreditation, that has (inline) childs called
persons.
Now I try to find the related accreditation of a person. I tried to
$this->accreditationRepository->findByUid($person->getAccreditation()); but
I got "Could not determine child object type". So I tried to write a
function returning just the accreditation-field, but I don't really know
how. The next try was to
$this->accreditationRepository->findByPersons($person); . But this returns
nothing.

A fourth idea was, simply to transfer the accreditation-object from one
action to another. But it seems, that inside a person-related partial, the
accreditation-object isn't available, or?

Has anyone an idea, how to get the parent object from a childobject?

Best regards

Johannes

_______________________________________________
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