We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Model meta data getAttributes() returning NULL

I'm trying to get a model's attributes from within the model. My test code looks like this:

\Tracy\Debugger::log(var_dump($this->getModelsMetaData()->getAttributes($this)));

All this does is log "NULL". I'm not caching meta data currently - so this is being generated every page load. Any ideas what's wrong?

I'm running 2.0.10

The model must be used before obtaining the meta-data. Try to perform a count/findFirst before.

I added $this->findFirst(); before the line above - same result.

Looking at my query log, I can see the DESCRIBE statement being executed, as well as the query for doing the findFirst().