[TYPO3-mvc] Get related 1:n object from external class

Gianluca Strafella gianluca.strafella at webformat.com
Fri Nov 15 09:01:38 CET 2013


Hey Henry,
I've understood this:

In your Model, \DoShell\TouristBbhotel\Domain\Model\Main
there is a property $conversionratenum, typed as: 
\DoShell\TouristShared\Domain\Model\Conversionrate

where is the Model "Room" ?

In your original request, the factors in multiplication were:

$conversionratenum
$roomratenum

  it's true ? But $conversionratenum is a Model, not a float ... so your 
method:

public function getSellingrate() {
     return $this->roomratenum * $this->conversionratenum;
}

should be:

public function getSellingrate() {
     return $this->roomratenum->getConversionratenum() * 
$this->conversionratenum;
}

Can be it?


Regards,
Gianluca

Gianluca Strafella

Software Developer
gianluca.strafella at webformat.com
Tel.   +39-0427-926.389

WEBFORMAT srl – www.webformat.com
Via Mecenate, 76 - 20138 MILANO
Corte Europa, 12 - 33097 SPILIMBERGO (PN)


Il 13/11/2013 14:45, Henry DoShell ha scritto:
> Hi Gianluca,
>
> thanks for the reply, yes there is a typo in the text, the multi its ok.
> The properties are in different models:
>
> \DoShell\TouristShared\Domain\Model\Conversionrate $conversionratenum
> \DoShell\TouristBbhotel\Domain\Model\Main $roomratenum
>
> Already tried to write an getter, but no luck:
>      /**
>      * Returns the conversionratenum
>      *
>      * @return \DoShell\TouristShared\Domain\Model\Conversionrate
> $conversionratenum
>      */
>      public function getConversionratenum() {
>         return $this->conversionratenum;
>      }
>
> its connected via $conversion rate, in FE its all right:
>
> Extbase Variable Dump
> DoShell\TouristShared\Domain\Model\Conversionrateprototypepersistent
> entity (uid=3, pid=39)
>    conversionratenum => 1.2 (double)
>    uid => 3 (integer)
>    _localizedUid => 3 (integer)modified
>    _languageUid => 0 (integer)modified
>    pid => 39 (integer)
>
> Thanks,
> Henry


More information about the TYPO3-project-typo3v4mvc mailing list