[SOLVED] catching own DB Table by using ORM::factory("static_menu")

fredhowe

Joined: 2012-05-28
Posts: 12
Posted: Thu, 2013-02-14 10:46

catching own DB Table "static_menus" by
ORM::factory("static_menu")
or by
db::build()->select()->from("static_menus")

Where is the magic by catching datas from my own created DB Table
in my own modul "pagemenu" to do this with

ORM::factory("static_menu")

it works only with

db::build()->select()->from("static_menus")

thanks in advance
Fred

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2013-02-14 16:43

Does your module have a models directory?
Did you extend the the ORM with a new class?
Look at existing modules to see examples of modules that have tables they have created and you will see all of them have a models directory and a file to extend the ORM.
Hope that helps as I'm a copy - paste type type of developer module maker. :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
fredhowe

Joined: 2012-05-28
Posts: 12
Posted: Fri, 2013-02-15 08:41

thanks Dave

That is was i need to know

quite simple

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-02-15 14:49

Since you mentioned menu might I suggest:
http://codex.galleryproject.org/Gallery3:Modules:Pages
or
http://codex.galleryproject.org/Gallery3:Modules:menu_links

Not sure if you are reinventing the wheel or not.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
fredhowe

Joined: 2012-05-28
Posts: 12
Posted: Fri, 2013-02-15 15:13

thanks for your attention Dave

no, i don't reinventing the wheel

I am just working on a dynamic page/menu module
for my Project.

and there for, i have two tables
the first one "static_pages" is working with ORM::factory(
bud the second one "static_menus" not.

the models is there
\modules\dynpages\models\static_page.php

thanks in advance
Fred