veryActiveRecord — seven12
السلام عليكم ورحمة الله وبركاته
7-12 framework now has better scaffolding and is clean urls [URL rewriting]
I’ve been working on it the last days but the very strange thing is .. I’m working shallow issues ..
Mainly, I forgot that seven12 have a MODEL problem .. Major problem .. it’s not yet an active record based one ..
so ..It’s not that handy if you tried to code your application if you didn’t not start from scaffolding then modifying, and in case you scaffolded you table you will still need to understand the fact of each model is a file and a different class which is -now- sounds so illogical to bind them all to a parent “doing a singleton connection–which almost nothing” class ..!
Sooo ..
I decided to code “veryActiveRecord” which will work on the 2-ways
1-it’ll enable you to have the row to object model
2-It’ll have the Object to row model through what I call “inversed scaffold”
Ex.
//normal active records ..
//assuming the table users exist “note the convention of plural table names will be fixed on scaffolding part ..”
//users table contains the four columns / fields id name email which is INT PK auto_increment NOT, varchar(50), varchar(200), respectively
$values=array(id=>NULL,
‘name’=>’Ahmed’,
‘email’=>’ahmed@ahmed.com’);
$user = new User();
$user->add($values);//this will work exactly like sending the query:
//insert into users values (NULL,’Ahmed’,'ahmed@ahmed.com’);
//user class contain relation parameter “class variable” describing the relation to other tables..
//which will be as high leveled as ROR “Ex. belongs to and has many ..”
Next is the inversed scaffolding ..
//my plan is to have no table sql already designed..
//developer will design how to handle the fields before creation
//inside the users class
$relations=array(‘has manyusers
‘,’belongs to
groups
‘);
$id = new intField();
$name = new strField(“unique”);
$email = new strField(“searchable”);
//and I’ll copy a feature from DJango calle s=dbsynch you will be able a fully compatible to your code SQL which can be directly or indirectly “copy paste to your console/phpMyAdmin” executed .
…
Well, It sounds a lot of code to write ..
but It sounds also sooo interesting when it’s done -that way- as it is a challenge for me ![]()
and I just love challenges ..
NOTE:
I’ll pause working on scaffolding for the moment ..
clean URLs will remain with the same procedure
better mail and better template engine is what I’m planning for ..
and there was a very important thing to talk about which I forgot while writing that topic ..
Make a prayer to remember ..
إن شاء الله ..
7-12-2008 will be a nice release isA
;may be the 1.0 release ..!
Salam

El Salam Alykom
I didn’t get all what you said but anyway it is not my game..at least for now
BTW, the project RSS is on my google reader and i didn’t receive any updates, something wrong ?
aha
bardo zay shabah makont ayelak :p
it’s called entities I thinks : http://code.google.com/p/h4ck3rz-mab/source/browse/classes/datamap.php
bas ana ele kan asdy 3aleeh a very Better idea , I didn’y see it in PHP , which is an Entity Framework , not only modeling a record (table ) , but Modeling the whole DB
you will have a DB class , make an instant of it for each DB you want , and you’ll have the tables ready for quering , my imagination is something like that :
$myDb = new DB (“mab”);
$rows1 = myDb=>Tables[0]=>getRows(“name=mohamed”);
//or may be :
myDb=>Tables[0]=>Rows[5]=>name = “mohamed”;
myDb=>Tables[0]=>Rows[5]=>phone= “234567″;
myDb=>Update();
I already made this in C# while trying to make my ORM DBMS
what is your opinion ?
nothing wrong ..y
It’s all minor changes happened ..
it’s Major changes but minor changes after all…
besides code just SMELLS ..
It’s functioning but it still smells ..:s
May be be day or two and I’ll be making a small how to and a code commit ..
Thanks for passing
Salam
very nice ya spam asde ya snap .. your comment was in the spam ..
I don’t know why ..
anyway Thank you
Really great info here… I found your site via bling and I will bookmark it and come back again!