docteurklein/repository-service-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

docteurklein/repository-service-bundle

Composer 安装命令:

composer require docteurklein/repository-service-bundle

包简介

A symfony bundle to help you register automatically doctrine ORM repositories as services

README 文档

README

What ?

A symfony bundle that eases creation of doctrine ORM repositories as services.

It will create a service for each registered entity in the default entity manager.

If you provide a repository tag for a service, it will automatically create an alias and configure doctrine to make it the custom repository class of the associated entity (specified by the for attribute).

How ?

install

composer require docteurklein/repository-service-bundle

register the bundle

    public function registerBundles()
    {
        $bundles = [
            new \DocteurKlein\RepositoryServiceBundle,
            // …
        ];

        return $bundles;
    }

Examples

Note: The following examples use JmsDiExtraBundle to simplify code.

Given an entity:

namespace Model;

/** @ORM\Entity */
class Product
{
    /** @ORM\Id */
    private $id;
}

And the following service:

namespace Repository;

/**
 * @Service("products")
 * @Tag("repository", attributes={"for"="Model\Product"})
 */
final class Products extends EntityRepository
{
}

Then the DIC contains a factory service named repo.model_product for the repository (using ManagerRegistry::getRepository()).

It also contains an alias named products pointing to the repo.model_product service.

The custom repository class is automatically configured to point to Repository\\Products.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固