[TYPO3-german] Extbase: Wann sind zwei Objekte gleich?
g4-lisz at tonarchiv.ch
g4-lisz at tonarchiv.ch
Tue Feb 17 02:59:38 CET 2015
Ich habe das "Problem" gefunden: Lazy Loading!
Die Relation Typ wurde mit der @lazy Annotation deklariert.
Folgender Code liefert das erwartete Ergebnis:
$typ1 = $leistung1->getTyp();
$typ2 = $leistung2->getTyp();
$typ1->getUid();
$typ2->getUid();
if ($typ1 === $typ2)
echo "Isso";
Isso.
Grüße,
Till
On 02/17/2015 02:38 AM, g4-lisz at tonarchiv.ch wrote:
> Hallo Zusammen,
>
> beim Vergleich zweier Objekte der selben Klasse und gleicher UID liefert
> if keinen Treffer,
> also:
>
> $objA === $objB : FALSE
> $objA == $objB : FALSE
> $objA->getUid() == $objB->getUid() : TRUE
>
> Etwas mehr im Detail:
>
> Ich habe die Klassen Leistung und Typ mit der Relationen:
>
> Leistung n : 1 Typ
>
> if ($leistung1->getTyp() == $leistung2->getTyp()) ...
> liefert nicht das gewünschte Ergebnis
>
> if ($leistung1->getTyp()->getUid() == $leistung2->getTyp()->getUid())
> aber schon.
>
> So ganz verstehe ich das nicht...
>
> Grüße,
> Till
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
More information about the TYPO3-german
mailing list