承接 evyex/doctrine-orm-extender 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

evyex/doctrine-orm-extender

最新稳定版本:0.2.0

Composer 安装命令:

composer require evyex/doctrine-orm-extender

包简介

Extension for Doctrine ORM.

README 文档

README

Extension library for Doctrine ORM that builds QueryBuilder/Query from a declarative ruleset.

What It Does

  • Creates a QueryBuilder from RuleSetInterface
  • Applies supported Doctrine expressions (where, orderBy, groupBy, join, select)
  • Binds parameters from the ruleset
  • Returns either a ready QueryBuilder or a final Query

Requirements

  • PHP ^8.1
  • doctrine/orm ^2.10|^3.0

Install

composer require evyex/doctrine-orm-extender

Example

Without ruleset object, query logic is usually assembled inline in repository/service methods. With this package, the same logic can be moved to a dedicated business ruleset class:

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Parameter;
use Evyex\DoctrineOrmExtender\QueryFactory\RuleSetInterface;

final class ClientGroupDogs implements RuleSetInterface
{
    public function __construct(private int $clientGroupId)
    {
    }

    public function getEntityClass(): string
    {
        return Animal::class;
    }

    public function getRootAlias(): string
    {
        return 'a';
    }

    public function getRules(): array
    {
        return [
            new Expr\Join(Expr\Join::INNER_JOIN, 'a.client', 'c'),
            new Expr\Andx(['c.group = :clientGroupId']),
            new Expr\Andx(['a.type = :animalType']),
        ];
    }

    public function getParameters(): ArrayCollection
    {
        return new ArrayCollection([
            new Parameter('clientGroupId', $this->clientGroupId),
            new Parameter('animalType', 'dog'),
        ]);
    }
}

Then usage becomes explicit and reusable:

$dogs = $queryFactory
    ->createQuery(new ClientGroupDogs(5))
    ->getResult();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固