[TYPO3-mvc] tt_content FAL in own extension
Frans Saris
franssaris at gmail.com
Fri Jun 6 09:17:10 CEST 2014
Hi,
originalResource is kind of lasy loaded in the getter. Try looping trough
the images and debug $image->getOriginalResource().
Gr. Frans
Op 6 jun. 2014 08:00 schreef "Stefan Kruse" <besucher80 at gmx.de>:
> Hi,
>
> i try to read out the tt_content records out of my own extension.
>
> I create a model with all the properties and getters/setters. Then i
> mapped the model to the tt_content table.
>
> To this step everything works fine, i can read out the records from the
> tt_content table. BUT:
>
> I dont get the images they are created with FAL. In my model i have this:
>
> /**
> * Image
> * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\
> TYPO3\CMS\Extbase\Domain\Model\FileReference>
> */
> protected $image;
>
> /**
> * Returns the image
> *
> * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image
> */
> public function getImage() {
> return $this->image;
> }
>
> /**
> * Sets the image
> *
> * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image
> * @return void
> */
> public function setImage($image) {
> $this->image = $image;
> }
>
> Ok, when i now make a debug output from my fetched tt_content records then
> i see the follow:
>
> images => TYPO3\CMS\Extbase\Persistence\ObjectStorageprototypeobject (1
> items)
> ...0000000004902dc8000000003d176148 => TYPO3\CMS\Extbase\Domain\Model\
> FileReferenceprototypepersistent entity (uid=1, pid=5)
> .......fileRepository => TYPO3\CMS\Core\Resource\
> FileRepositorysingletonobject
> ........... originalResource => NULL
> ........... uid => 1 (integer)
> ........... _localizedUid => 1 (integer)modified
> ........... _languageUid => 0 (integer)modified
> ........... pid => 5 (integer)
>
> The field originalResource is always empty. It thinks this is not right or
> is it?
>
> How can i read out the images correctly? It would be very nice if somebody
> has a tip. Thanks a lot. Stefan
> _______________________________________________
> 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