I don't know who used propel to do orm,propel efficiency. It's OK, write it like this:
1. $author = new author ();
2. $author->setfirstname (' Jane ');
3. $author->setlastname (' Austen ');
4. $author->save ();
The anthor here are the classes corresponding to the author table, 2,3,4 very clear, FirstName, and LastName are the field names in the table. This is convenient to use. I looked at its model, mapped the fields in the table into classes and methods, and wrote six or seven files. But I think, If you use rails, it doesn't have to be so troublesome. There is a method_missing,php in Ruby's meta-programming that mimics it to get a __call function. The two functions have the same meaning: if I call a non-existent method, this function will be processed.
So, we can emulate rails, for example, I don't write a bunch of files like propel, but I can still write like propel:
I can write: $author->setfirstname (' Jane ');
You might ask, "you don't define this function at all, how do you use it?" The answer is that you can use the _call to take the function name and parameters, and then parse it, as if it really exists, and rubyonrails is doing it. The result I want to use a file is enough.