j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

IteratorAggregate, ArrayAccess, Countable #51

Closed Surt closed 11 years ago

Surt commented 12 years ago

Would be great to implement that interfaces instead the actual set, get. Not instead, I mean "in addition"

treffynnon commented 11 years ago

Extending ArrayObject would be the preferable route here I think.

tag commented 11 years ago

I can kinda see a use for this in Idiorm, but now with the introduction of ::as_array(), I'm not sure it's necessary. It's less clear to me how this would be useful in Paris.

treffynnon commented 11 years ago

@tag see https://github.com/j4mie/paris/pull/14 for an example of its use in Paris. In Idiorm I think this would complement as_array nicely and in v2 probably replace it all together in preference to:

$array = (array) $orm_instance;
treffynnon commented 11 years ago

ArrayAccess added for ORM property access in commit 598927d

treffynnon commented 11 years ago

Added in commit 5a6d20c

sanmayad commented 4 years ago

Asking to implement Countable Interface after PHP 7.2