当前位置: 软件>php软件
轻量级的 ORM 框架 MercuryORM
本文导语: MercuryORM 是一个轻量级的 ORM 框架,基于 Entity Framework 开发。示例代码:$user = new ModelsUser(); $user->setFirstName('John'); $user->setLastName('Smith'); $user->setEmail('j.smith@mail.com'); $post = new ModelsPost(); $post->setTitle('My first post'); $post->setBody...
MercuryORM 是一个轻量级的 ORM 框架,基于 Entity Framework 开发。
示例代码:
$user = new ModelsUser(); $user->setFirstName('John'); $user->setLastName('Smith'); $user->setEmail('j.smith@mail.com'); $post = new ModelsPost(); $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();