sminnee

everything that comes out of a simplexml object is an object until you cast it, and CMS doesn’t know what to do with that.

🙏 (1) 👍 (1)
greg_808

The problem was I expected the api to return data in the same format. All I needed to add to my code was a html_entity_decode() now i can use .RAW on a the template.

sminnee

on the other example you might need to cast the element to a string

  1. DBField::create_field('HTMLFragment', (string)$NewsArticle['text'])

or

  1. (string)$NewsArticle['text']
sminnee

what about

  1. if ($singleArticleData) {
  2. return [
  3. 'NewsArticle' => new ArrayData($singleArticleData)
  4. ];
  5. }
sminnee

I’ll see if someone at work is keen to make an Alexa receptionist on hack day and, if so, drop you a line :-)

👍 (1)
sminnee

Scaffolding data objects from an existing database schema is an interesting problem-space

👍 (2)