PHPackages                             albertborsos/yii2-ddd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. albertborsos/yii2-ddd

ActiveLibrary[Framework](/categories/framework)

albertborsos/yii2-ddd
=====================

Classes for Domain-Driven Development with Yii 2.0 Framework

1.0.1(6y ago)1830.4k↓33.3%1[1 PRs](https://github.com/albertborsos/yii2-ddd/pulls)1MITPHPPHP &gt;=7.1.0CI failing

Since Jan 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/albertborsos/yii2-ddd)[ Packagist](https://packagist.org/packages/albertborsos/yii2-ddd)[ RSS](/packages/albertborsos-yii2-ddd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (19)Used By (1)

[![Build Status](https://camo.githubusercontent.com/6f029ff1a63db969f4cb0144cfb5da57bf4cb17ca0ba12911329fef6a4f4f9dc/68747470733a2f2f7472617669732d63692e6f72672f616c62657274626f72736f732f796969322d6464642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/albertborsos/yii2-ddd)[![Coverage Status](https://camo.githubusercontent.com/54c88697176d492bf213baa3a9476c6da876b1d6ecdaac7ff5ddd49608c7532c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616c62657274626f72736f732f796969322d6464642f62616467652e737667)](https://coveralls.io/github/albertborsos/yii2-ddd)

DDD Classes for Yii 2.0
=======================

[](#ddd-classes-for-yii-20)

Classes for a Domain-Driven Design inspired workflow with Yii 2.0 Framework

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Run

```
php composer.phar require --prefer-dist albertborsos/yii2-ddd

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Lets see an example with a standard `App` model which is an implementation of `\yii\db\ActiveRecord` and generated via `gii`. I recommend to do not make any modification with this class, but make it `abstract` to prevent direct usages.

Then create a business model which extends our abstract active record class and implements `BusinessObject` interface. Every business logic will be implemented in this class.

```
