Zum Inhalt springen

Tx_Extbase_Persistence_QueryResult to JSON

Erstellt am 18. Oktober 2012 · 1 Antwort · letzte Antwort am 18. Oktober 2012

Tags: Frage

zeitgenosse ·

aloha,

ich versuche ein extbase Tx_Extbase_Persistence_QueryResult (items mit contained items) in ein JSON-Object zu konvertieren oder zu serialisieren.

Dies scheint ziemlich mühsam zu sein.

Hat da jemand erfahrung?

was nicht wirklich funktioniert:

$array = (array) $queryResult;
$json = json_encode($array);

spuckt dies aus:

'{ "\u0000Tx_Extbase_Persistence_QueryResult\u0000warning&qu
   ot;: "You should never see this warning. If you do, you probably us
   ed PHP array functions like current() on the Tx_Extbase_Persistence_QueryRes
   ult. To retrieve the first result, you can use the getFirst() method.&qu
   ot;, "\u0000*\u0000dataMapper": { }, &quo
   t;\u0000*\u0000persistenceManager": { }, "\u0000*
   \u0000query": { }, "\u0000*\u0000queryResult&
   quot;: null }'

dann würde mich auch noch interessieren wie ich diesen error wegbekomme, im $queryresult:

"You should never see this warning. If you do, you probably us
ed PHP array functions like current() on the Tx_Extbase_Persistence_QueryRes
ult. To retrieve the first result, you can use the getFirst() method."

viele grüsse