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-l...@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@lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an