I have a classical course and dates relation (one course has many dates). The next courses shall be listed on a page. I loaded all dates with the normal findAll() method with sorting by startDate. Now i need the parent course information in order to show course details.
In the date controller i have
/**
* Course
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\ITServicePN\ItspnKurse\Domain\Model\Kurse>
*/
protected $kurse = NULL;
/**
* Returns the Courses
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\ITServicePN\ItspnKurse\Domain\Model\Kurse> $kurse
*/
public function getKurse() {
return $this->kurse;
}
This returns me the course when using f:debug {date.kurse}:
TYPO3\CMS\Extbase\Persistence\ObjectStorageprototypeobject (1 items) ... => ITServicePN\ItspnKurse\Domain\Model\Kurseprototypepersistent entity (uid=8, pid=51)
title => 'The name of the course' ...
But when i try to access {date.kurse.title} i got a TYPO3 exception:
#1: PHP Warning: spl_object_hash() expects parameter 1 to be object, string given in /var/www/vhosts/it-service-pn.de/cetba/typo3_src-6.2.3/typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php line 174
What to do, to get the parents object information properly with extbase and fluid?