Yii persistence
Host: Yii Yii3 (yiisoft/*); Yii2 brownfield (PHP ≥ 8.2 (Yii3)) · Researched 2026-08
One-shot:/apply/yii.full.md· Short:/yii
Yii3 + Cycle
Use yiisoft/yii-cycle. Cycle entities and schema config stay in Infrastructure.
{Module}/Infrastructure/Persistence/Cycle/
Entity/
Repository/
Repositories implement Domain ports and map Cycle records → Domain Entities.
Yii2 brownfield
yii\db\ActiveRecord only inside Infra repositories. Never in Domain/Use Cases.
Anti-patterns
| Smell | Fix |
|---|---|
| AR in Use Case | Port + Infra repo |
| Cycle ORM injected into Domain | Port only |