Hello everybody,
I've developed an small code for automaticaly generate on the fly a class code equivalent to what the POG generator does,
using the information available directly from database metainfo. I have not tested with other plugins but I don't see
any problem as it respects the "pog_attribute_type" attribute.
The use is truly easy, for example, if you have a table in your database called "cursos", just write the code and use:
$curso = new cursos();
$curso = $curso->Get(857);
echo $curso->id, ":", $curso->denominacion, "\n", var_dump($curso->pog_attribute_type);
$cursos = $curso->GetList(array(),"",true,1);
$curso = $cursos[0];
echo $curso->id, ":", $curso->denominacion, "\n", var_dump($curso->pog_attribute_type);
}
Summary:
Flaws:
- It is not 100% compatible as it doesn't support Save or Delete functions YET.
- It doesn't respect the naming convenctions for class ids (for example "objectId") either.
- It doesn't work with parent/sibling relationships, like POG does.
Pros:
- You may read from the database directly using objects, Get and GetList methods.
- It should work with most POG plugins.
Feel free to comment and request more functionality.
Have a nice day! :-)