Download the PHP package veasin/ff-ddd without Composer

On this page you can find all versions of the php package veasin/ff-ddd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ff-ddd

veasin/ff-ddd

基于 veasin/ff 函数式框架的 DDD 业务建模层。 概念配置驱动:抽象与数据操作分离 —— then 之前只构建概念配置,then 触发才执行数据操作。

安装

veasin/ff 为依赖项,框架函数(如 ff\db、ff\container)通过 composer 的 autoload.files 自动加载。

核心概念

术语 说明
概念 领域模型最小单元,由 ddd::define() 定义,概念名全小写 / 分隔,如 corp/user
集合 概念的一组实例,可被范围方法分割,ddd::collection(name) 开链
单体 集合经 id()/create() 缩小到的唯一元素,ddd::entity(name) 开链
范围 对集合的筛选条件,链上每一步都在叠加
关系 概念间的关联(从属导航),触发根转化 + 范围转换
配置 概念的全部定义,then 前链式操作的最终产物

铁律

  1. 抽象与数据操作分离(then 前只构建配置)
  2. 集合 → 范围方法 → 新集合;单体 → 关系方法 → 集合/单体
  3. 一切显式,无自动推导(概念必须 define)

配置结构

ddd::define(name, $colCfg, $entCfg) 将集合与单体配置分离为第二、三参数,各自独立归一化、独立存储,不合并。

子类型

集合配置(colConfig,第二参数)

单体配置(entConfig,第三参数)

字段归属

字段 colConfig entConfig 说明
source ✅ ✅ 实体构造时 ent→col fallback
defs ✅ ❌ 集合专属
relations ❌ ✅ 单体专属
uniques ✅ ✅ 实体构造时 ent→col fallback
mutators ✅ ✅ 实体构造时 ent→col fallback
with ✅ ✅ 独立存储不合并;读取时整数组 ent→col fallback
order ✅ ❌ 仅集合配置持有
base ✅ ✅ 同类型继承(col→col, ent→ent)

配置分离强制规则:colConfig 不含 relations/create;entConfig 不含 defs/entity。normalize() 阶段强制执行(传入即剥离)。

视图构造 fallback

实体构造时,最终配置 = entConfig 为基底,以下共享字段若 entConfig 不存在则从 colConfig 回退读取:

共享字段仅 source、uniques、mutators 三项。order 不属于共享字段——实体没有默认排序。

with 为特例:独立存储、不做构造期合并,仅在读取时由 concept 整数组 fallback(ent.with ?? col.with)。entity 定义了 with 则整数组遮蔽 col(不按段回退);未定义则读 col 的 with。

base 继承

base 仅同类型继承(colConfig→父 colConfig,entConfig→父 entConfig),不跨类型:

正常化(normalize)拆分

集合和单体各自独立归一化:

with 查询级联

with 用于"查询主概念时同时 JOIN 关联概念、带出额外字段"。配置在集合(默认),单体可额外定义(整数组遮蔽集合)。

返回形态:主表不设别名(字段用限定符限定:表带别名用别名、否则用表名),join 表别名 = 配置 key。fields 为字段列表时直接输出 别名.字段(不设别名);fields 为 输出键 => 字段 时重命名输出。join 生效时,ON / WHERE / ORDER BY 的字段一律用主表限定符限定(防同名列歧义):

trigger 签名(末尾参数 = with 段名):

规则:

自定义 Trigger 扩展

业务方法(如 launch()、toggleSkip())属于"找到实体后的数据操作",应放在 Trigger 上。通过 lv0 配置注入 trigger 即可,不必绕三层继承:

同样支持集合 Trigger 扩展(继承 trigger\collection)。若需自定义 Entity(如有额外导航方法),配置 entity 指定 fork 目标:

快速开始

IDE 辅助

生成 PhpStorm 元数据(override / expectedArguments / registerArgumentsSet), 以及 IDE 桩类(_ddd 命名空间,@method 标注 defs / relations / 自定义方法)。 支持 lv1 class 反射 + base 继承链合并。collection() 和 entity() 各自独立提示列表。


All versions of ff-ddd with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
veasin/ff Version >=0.3.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package veasin/ff-ddd contains the following files

Loading the files please wait ...