Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM v1.8.1
#91

[eluser]WanWizard[/eluser]
That functionality isn't provided.

But is shouldn't be to difficult to write a recusive function using the level returned in the array.
#92

[eluser]Nicolas L.A.[/eluser]
That's what I thought.

Thanks for the reply.
#93

[eluser]psychoder[/eluser]
is there a way where i can use datamapper with flexigrid?

coz in datamapper, database should not be autoloaded while in flexigrid it should be...

thanks...

regards....
#94

[eluser]WanWizard[/eluser]
I don't understand your question.

Datamapper is a server-side database abstraction layer, Flexigrid is a client-side Jquery solution to display tables, which requires json input.

I think Google can provide you will examples on how to implement Flexigrid, you'll have to make a controller that provides the data in json format, and will accept json posts if you want to allow updates...
#95

[eluser]Flyingbeaver[/eluser]
HI,


I have waited one month to post here, i'm close to the point where I perfectly know the documentation... but i still fail at doing what I want. I hope you guys can help me.


Here is my problem :

I have a table services with a self relationship :


services => id, url, title
related_services_services => id, service_id, related_service_id (i know it should be services_services, but It just doesn't want to work this way...)


I would like to get an array with the field of the service, and the field of the different related services...


I have tried, include_related, sub_queries, join fields, some work some don't. And when they work I just don't get what I want...


PLZ help me !
#96

[eluser]WanWizard[/eluser]
It's not entirely clear to me what you exactly want.

Could you create a dummy array and var_dump it, so I can see what kind of structure you're looking for?
#97

[eluser]Mantero[/eluser]
I really don't know how to integrate datamapper with hmvc

anyone know where I can download pre-built CI with datamapper+hmvc?
#98

[eluser]WanWizard[/eluser]
There is not much to integrate.

Datamapper works in an HMVC environment, with the restriction that cross-module model usage is not fully supported. Which means you can load/use a model from another module, but that model can't load it's language files.

Also, Datamapper can only find models in active modules, which by default is only the current active module. To work around that, either use Datamapper's model_paths property to define additional model locations, or use HMVC's $this->load->_add_module_path() to have Datamapper access models in a module.
#99

[eluser]Flyingbeaver[/eluser]
[quote author="WanWizard" date="1309958773"]It's not entirely clear to me what you exactly want.

Could you create a dummy array and var_dump it, so I can see what kind of structure you're looking for?[/quote]


Sure !

Code:
array (
    'service' =>
        array (
            'id' => 1,
            'title' => 'Parent Service',
            'url' => 'parent_service',
        ),
            'related_services' =>
                array (
                    0 =>
                        array (
                        'service_id' => 2,
                        'service_title' => Test2,
                        'service_url' => test2,
                        ),
                    1 =>
                        array (
                        'service_id' => 3,
                        'service_title' => Test3,
                        'service_url' => test3,
                        ),
)


So in my database I have the table service in this way :

Code:
Services
id   url                      title
1    parent_service    Parent service
2    test2                  Test2
3    test3                  Test3


And the relationship table :

Code:
Related_services_services
id service_id related_service_id
2  2              1
3  3              1


Si I would like to get the array at the top of the post but also be able to get the parent service of service (if it exists).

Thx so much for your help.

[eluser]Colm Ward[/eluser]
Just an FYI, when I upgraded to the latest datamapper (1.8.1) I got this error:
Fatal error: Class 'CI_Lang' not found in C:\...\application\libraries\datamapper.php on line 6749

I'm running Codeigniter 1.7.2. But editing datamapper.php and changing the line
Code:
class DM_Lang extends CI_Lang
to
Code:
class DM_Lang extends CI_Language
sorted it out.

keep up the good work
cheers
Colm




Theme © iAndrew 2016 - Forum software by © MyBB