happy new year everybody
So i'm quite busy these days but i took time yesterday to (re)write my personal framework for a public module.
everything is on Github :
https://github.com/besstiolle/orm-ms
i encourage you to follow this repository because the code is only an alpha version of my goal and will change a lot these next days
You will find the source of the module "Orm", the core of my work. It's a simple cmsms's module.
You will also find the source of the module "Poc", it's a (very) simple example of the use of the Orm. it isn't completed at this moment
What is functionnal :
- you can describe your entities (see /Poc/lib/class.entity.***.php for some examples)
- you don't have to specify something else, everything is automatised (autoload powa !)
- you can also automatise the creation of your tables, create/drop (see /Poc/method.(un)install.php)
Should also work (but i didn't test it since yesterday, and i didn't made any example)
- insert, update, delete, select [all], ...
- select by an example
- deep search (eg: select all customers where customers.adresses.country is "France")
- a (too much) simple caching to avoid too much request on database
- a simple debug system (Trace.debug|info|warn|error("hello"))
- a Sorting declaration let you describe how to sort a list of your entites
You can use these declarations for your entities :
- primaryKey, foreignKey (0,1->N) , AssociateKey (N<->N)
- Date, TimeStamp, Integer, Number, String, Buffer ....
- Size
- Nullable, or not
Since my presentation during the geekmoot i removed (or i will remove) some stuff because my (new) opignon is that an Orm must only do Orm stuff and not more. So i removed :
- the validator system (regex validation on a field)
- the html generator system ( a database field => a html field)
- the search entity, it was useless because basically it's like doing a select by example.
Of course, it's only documented in french but i will translate it as soon as possible.
At this point, i very happy to doing this work : it's easy to understand, to implement and it doesn't need any massive modifications in you current code to work.
and obviously it's using only the Api of cmsmadesimple
returns and notices are obviously more than welcome!