MercuryORM轻量级的 ORM 框架
MercuryORM 是一个轻量级的 ORM 框架,基于 Entity Framework 开发。
示例代码:
$user = new Models\User(); $user->setFirstName('John'); $user->setLastName('Smith'); $user->setEmail('j.smith@mail.com'); $post = new Models\Post(); $post->setTitle('My first post'); $post->setBody('This is my first blog post'); $post->setAuthor($user); $blogContext = new BlogContext(); $blogContext->getUsers()->add($user); $blogContext->getPosts()->add($post); $blogContext->saveChanges();
评论