entity: fixed toArray()
support for associations