I am trying to find the best way to limit data for a specific query when using Orm_Model::to_array().
In the case below, I would like to limit properties in the "accounts" model.
Generally in cases like this I either just build my own array only keeping the parts I want to reveal, or once in awhile I might do the opposite, and use Orm_Model::to_array() and unset the elements I want to hide after that.
But I was thinking how can I set the $_to_array_exclude properties on the fly before executing my query, and then reset it to it's original value.
If you mean you want to be able to filter the result of to_array(), like the ORM equivalent can, it's probably best to create a Model_Crud base model, add a method to define the filter, and overload the to_array() method to honour the defined filter.