定制 managlea/entity-manager 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

managlea/entity-manager

Composer 安装命令:

composer require managlea/entity-manager

包简介

README 文档

README

Scrutinizer Code Quality Build Status Code Coverage
Code Climate Test Coverage
SensioLabsInsight
Codacy Badge
Build Status Circle CI
PHP-Eye

Wrapped on top of different database connectors to provide general interface. Currently supports only Doctrine ORM.

##Basic usage (DoctrineEntityManager):

// Create directly
$em = new DoctrineEntityManager($entityManager);

// Create using factory (recommended)
$em = new EntityManagerFactory($containerBuilder)->create('doctrine_entity_manager');

// Get single entity
$entity = $em->get('Entities\Product', 1);

// Get single entity (with additional criterias)
$entity = $em->get('Entities\Product', 1, array('user_id' => 2));

// Get collection
$entityCollection = $em->getCollection('Entities\Product');

// Create new entity
$newEntity = $em->create('Entities\Product', array('name' => 'foo'));

// Update newly created entity
$updatedEntity = $em->update('Entities\Product', $newEntity->getId(), array('name' => 'bar'));

// Delete update entity
$em->delete('Entities\Product', $updatedEntity->getId());

As all existing Doctrine functionality is left intact you are also able to use all Doctrine ORM build in methods:

$em = new DoctrineEntityManager($entityManager);

$user = new User;
$user->setName('Mr.Right');

$em->persist($user);
$em->flush();

统计信息

  • 总下载量: 203
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-02