14 de July, 2008
Clasificado bajo: Uncategorized | Sin comentarios »
3 de June, 2008
Here is a new version of the php activerecord i hope you like.
http://code.google.com/p/pactiverecord/downloads/list
Clasificado bajo: Uncategorized | Sin comentarios »
10 de July, 2007
Here is my own version of the Active Record pattern for PHP and MySQL. As you can see the class is a little rudimentary but the idea was to do something simple that work always.
PHP Active Record v0.001
How to use it?
Simple extend your model from the Active Record class
Example
Table 1:
Members
* id
* name
* email
Table 2:
Posts
* id
* title
* member_id
File 1: member.php
class Member extends ActiveRecord
{
var $has_many = array("Posts");
}
File 2: post.php
class Post extends ActiveRecord
{
var $belongs_to = array("Member");
}
File 3: index.php
< ?php
$member = Member::new_instance('Member');
$member->find(’All’); // returns a member object array
$member->find(3); // set meber where id=3
$member->Posts; // returns a post object array
?>
I really wanted to write something better, but first English is no my nature Language, and second is 2:41 am. So when I found a little time I will update the info, meanwhile if you want you can put you review at the comments section
Clasificado bajo: Uncategorized, DePePe | 2 comentarios »
4 de June, 2007
Clasificado bajo: Fireworks, DePePe | 2 comentarios »