I'm using a generic Volt template used for paginator model results.
Depending if I define columns or not in my find or query-builder, a paginator item will be a Model object (
Phalcon\Mvc\Model), or it will be
(For some background info on this, see: http://forum.phalcon.io/discussion/1297/findfirst-inconsistent-return-objects)
The Row class implements ArrayAccess, Phalcon\Mvc\Model does not. This poses a bit of a problem in my template (where I (currently) expect array access), unless I do some kind of pre-processing, or making sure I always specify the columns in my query.
Wouldn't it be a good idea to add ArrayAccess to models? Or is this not possible, or would it be inefficient somehow?
A solution for me would be to just access the items as an object of course, but ArrayAccess is quite handy in Volt when you're using variable property names, as this won't work out of the box otherwise (see: http://forum.phalcon.io/discussion/1231/volt-access-to-object-property-using-variable)
ps. I'm aware of the
toArray() method, but I believe/ already assessed it doesn't quite work the same as the ArrayAccess of the Row class.