[Neos] Re: How to read values from a model-object in PHP (Controller)

Mario Hinterreiter m.hinterreiter at gmail.com
Mon Mar 17 11:02:25 CET 2014

With help from Axel Wüstemann at the mailing list I found this solution:

My case was a bit complex because my basket, which only lives in the user-session, just holds references to an offerModel which of course has a repository. The session basket is based on TheDefinitiveGuide > PartIII > SessionHandling

My solution was the propertyMapper:
$item['offer'] holds the identity of my offer-object, and so this line fetches it:
$singleOffer = $propertyMapper->convert($item['offer'], 'MY\Package\Domain\Model\Offer');

.. and now the getter works perfectly:
$price = $singleOffer->getPrice();

Thanks for help!!

More information about the Neos mailing list