承接 kaliop/content-decorator-bundle 相关项目开发

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

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

kaliop/content-decorator-bundle

Composer 安装命令:

composer require kaliop/content-decorator-bundle

包简介

Decorate your Ibexa content with custom model classes.

README 文档

README

Kaliop Content Decorator Bundle is an Ibexa extension inspired by eZObjectWrapperBundle. It lets you work with Ibexa Content objects as typed models plus dedicated repositories.

Instead of using raw content objects everywhere, you map content types to custom classes extending Kaliop\Contracts\ContentDecorator\Model\ContentDecorator.

Compatibility

Bundle line Ibexa Symfony PHP
1.x 4.6 5.4 LTS >= 8.1
2.x 5.0 7.4 LTS >= 8.3

Installation

composer require kaliop/content-decorator-bundle

If Symfony Flex does not enable the bundle automatically, register it in config/bundles.php:

return [
    Kaliop\Bundle\ContentDecorator\KaliopContentDecoratorBundle::class => ['all' => true],
];

Quick Start

  1. Configure mappings:
# config/packages/kaliop_content_decorator.yaml
kaliop_content_decorator:
    default_class: App\Model\GenericContent
    default_repository_class: Kaliop\ContentDecorator\Repository\ContentRepository
    mappings:
        App:
            namespace: 'App\Model'
            dir: '%kernel.project_dir%/src/Model'
  1. Create a decorator class:
<?php

declare(strict_types=1);

namespace App\Model;

use Kaliop\ContentDecorator\Attribute\Decorator;
use Kaliop\Contracts\ContentDecorator\Model\ContentDecorator;

#[Decorator(repositoryClass: App\Repository\ArticleRepository::class, contentTypes: ['article'])]
final class Article extends ContentDecorator
{
}
  1. Create a repository:
<?php

declare(strict_types=1);

namespace App\Repository;

use Kaliop\ContentDecorator\Repository\AbstractContentRepository;

final class ArticleRepository extends AbstractContentRepository
{
    public function findByAuthorId(int $authorId): array
    {
        // Implement query logic
        return [];
    }
}
  1. Use ContentDecoratorManager in your service/controller:
$repository = $contentDecoratorManager->getRepository(App\Model\Article::class);
$articles = $repository->findByAuthorId(42);

Configuration

kaliop_content_decorator:
    default_class: App\Model\GenericContent
    default_repository_class: Kaliop\ContentDecorator\Repository\ContentRepository
    mappings:
        App:
            namespace: 'App\Model'
            dir: '%kernel.project_dir%/src/Model'
    content_types:
        article: App\Model\Article

Injectors

Decorators are not Symfony services. Use injectors to add services during decoration. Implement Kaliop\Contracts\ContentDecorator\Injector\InjectorInterface and tag as kaliop.content_decorator.injector (autoconfiguration handles this automatically).

Default injectors:

  • ConfigResolverInjector
  • IbexaRepositoryInjector
  • ImageVariationInjector
  • LoggerInjector
  • ManagerInjector
  • TranslatorInjector
  • UrlGeneratorInjector

Performance and Method-Level Cache

  • Decorated instances are cached in memory per request.
  • Proxy classes can cache selected method results.
  • Mark methods with #[Cacheable].
  • Method parameters must be serializable.
use Kaliop\ContentDecorator\Attribute\Cacheable;

#[Cacheable]
public function getExpensiveComputation(): array
{
    return [];
}

Contribute

The tool comes with quite a few built-in fixers, but everyone is more than welcome to contribute more of them.

License

This library is released under the MIT license. See the included LICENSE file for more information.

kaliop/content-decorator-bundle 适用场景与选型建议

kaliop/content-decorator-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 431 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「content」 「symfony-bundle」 「repository-pattern」 「ibexa」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 kaliop/content-decorator-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kaliop/content-decorator-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 kaliop/content-decorator-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-06