Welcome Guest, Not a member yet? Register   Sign In
Datamapper undocumented function?
#1

[eluser]Thecodingdude[/eluser]
I read a post yesterday, which helped me with my solution to a problem, the code was:

Code:
foreach ($o->fields as $key => $field)
        {
        echo "Field $key is $field<br>\n";
        }

I could not fiend fields anyway in the documentation, perhaps it should be as it is a very useful feature Smile
#2

[eluser]WanWizard[/eluser]
$fields is mentioned in the docs as a reserved name.

It it not in the documentation because it's an internal data structure, and might not be available outside your model in future versions of Datamapper.
#3

[eluser]Thecodingdude[/eluser]
Thanks for the fast response.

By the way, I just released a new product built on your ORM:

http://codecanyon.net/item/epermission-c...ary/409644
#4

[eluser]jorgeguberte[/eluser]
[quote author="Thecodingdude" date="1312140974"]I read a post yesterday, which helped me with my solution to a problem, the code was:

Code:
foreach ($o->fields as $key => $field)
        {
        echo "Field $key is $field<br>\n";
        }

I could not fiend fields anyway in the documentation, perhaps it should be as it is a very useful feature Smile[/quote]

Coincidentally (or not), i asked that question (how to get the fields) on Stackoverflow a few days ago: http://stackoverflow.com/questions/68482...mapper-wit
#5

[eluser]Vheissu[/eluser]
[quote author="Thecodingdude" date="1312159582"]Thanks for the fast response.

By the way, I just released a new product built on your ORM:

http://codecanyon.net/item/epermission-c...ary/409644[/quote]

Nice one brother. Just bought this, looks great for someone who wants to learn how to use DataMapper.
#6

[eluser]Thecodingdude[/eluser]
[quote author="Vheissu" date="1312184930"][quote author="Thecodingdude" date="1312159582"]Thanks for the fast response.

By the way, I just released a new product built on your ORM:

http://codecanyon.net/item/epermission-c...ary/409644[/quote]

Nice one brother. Just bought this, looks great for someone who wants to learn how to use DataMapper.[/quote]

Thanks so much man, appreciate it. Please feel free to leave any comments/feedback.




Theme © iAndrew 2016 - Forum software by © MyBB