承接 clutch-property-mgmt/content-domain 相关项目开发

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

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

clutch-property-mgmt/content-domain

最新稳定版本:1.3.2

Composer 安装命令:

composer require clutch-property-mgmt/content-domain

包简介

Shared CMS domain models for PHP SSR apps. Provides pure, framework-agnostic entities (Page, PageSection, Review, SeoMeta, Navigation, etc.) with attribute-based validation via [phpolar/model]. Designed for Clean Architecture: no infrastructure, no PDO—just content-focused domain objects.

README 文档

README

Shared CMS domain models for PHP SSR apps. Provides pure, framework-agnostic entities (Page, PageSection, Review, SeoMeta, Navigation, etc.) with attribute-based validation via [phpolar/model]. Designed for Clean Architecture: no infrastructure, no PDO—just content-focused domain objects.

Table of Contents

Goals

  • Pure domain for CMS/content concerns
  • Reusable across storefront (read-only) and storefront-admin (read-write)
  • Stable contracts with small, composable objects
  • Validation via attributes using phpolar/model
  • Zero infrastructure: no PDO, no frameworks, no I/O side effects

What’s Included

  • Core CMS entities and value objects:
    • Page, PageSection, Block, SeoMeta, Slug, Navigation, MenuItem, Review (example set)
  • Attribute-based rules for validation/normalization
  • Minimal helpers for content-domain business rules (publishability, visibility windows, etc.) that do not perform I/O

What’s Not Included

  • No repositories, PDO, or persistence code
  • No controllers or framework glue
  • No caching, logging, HTTP, or config loading

Keep infrastructure in the application layer (e.g., storefront, storefront-admin). This package should remain framework- and storage-agnostic.

Install

composer require clutch-property-mgmt/content-domain

Requires PHP 8.2+ and phpolar/model.

Usage

Entities

<?php
use ContentDomain\Content\Page;
use ContentDomain\Content\SeoMeta;
use ContentDomain\Content\PageSection;

$seo = new SeoMeta(title: 'Apartments in Midtown', description: 'Spacious, modern units', keywords: ['apartments','midtown']);
$page = new Page(
    id: null,
    slug: 'midtown-apartments',
    title: 'Midtown Apartments',
    sections: [ new PageSection('hero', ['headline' => 'Live in Midtown']) ],
    seo: $seo,
    publishedAt: new \DateTimeImmutable('2025-01-01T00:00:00Z'),
);

Validation with phpolar/model

Use PHP attributes from phpolar/model on properties to enforce constraints.

<?php
use Phpolar\Model\Attributes as Assert;

final class Slug
{
    public function __construct(
        #[Assert\NotBlank]
        #[Assert\Pattern('/^[a-z0-9-]+$/')]
        public readonly string $value,
    ) {}
}

Immutability / Value semantics

Favor immutable value objects (e.g., Slug, SeoMeta) and explicit methods to derive new instances rather than in-place mutation. Entities may carry identifiers; value objects should not.

Directory & Namespaces

src/
  Content/
    Page.php
    PageSection.php
    SeoMeta.php
    Slug.php
    Review.php
    Navigation.php
    MenuItem.php
  Validation/
    (attribute helpers, if any)
  • Root namespace: ContentDomain\\...
  • Public API is limited to types under ContentDomain\Content and documented helpers.

Versioning

  • Semantic Versioning (SemVer): MAJOR.MINOR.PATCH
  • Breaking changes only in MAJOR releases

Contributing

  1. Fork and create a feature branch
  2. Add tests and docs
  3. Ensure CI passes (coding standards, static analysis, unit tests)
  4. Open a PR with a clear description and rationale

License

MIT License. See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2026-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固