Download the PHP package mootensai/yii2-relation-trait without Composer
On this page you can find all versions of the php package mootensai/yii2-relation-trait. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mootensai/yii2-relation-trait
More information about mootensai/yii2-relation-trait
Files in mootensai/yii2-relation-trait
Package yii2-relation-trait
Short Description Yii 2 Models load with relation, & transaction save with relation
License BSD-3-Clause
Homepage http://github.com/mootensai/yii2-relation-trait
Informations about the package yii2-relation-trait
yii2-relation-trait
Yii 2 Models add functionality for load with relation (loadAll($POST)), & transactional save with relation (saveAll())
PLUS soft delete/restore feature!
Best work with mootensai/yii2-enhanced-gii
Support
https://www.paypal.me/yohanesc
Endorse me on LinkedIn
https://www.linkedin.com/in/yohanes-candrajaya-b68394102/
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
file.
Usage At Model
Array Input & Usage At Controller
It takes a normal array of POST. This is the example
Features
Array Output
Use Transaction
So your data will be atomic (see : http://en.wikipedia.org/wiki/ACID)
Use Normal Save
So your behaviors still works
Add Validation At Main Model
will give you
It Works On Auto Incremental PK Or Not (I Have Tried Use UUID)
See here if you want to use my behavior :
https://github.com/mootensai/yii2-uuid-behavior
Soft Delete
Add this line to your Model to enable soft delete
Add this line to your Model to enable soft restore
Should work on Yii's supported DB
It use all Yii's Active Query or Active Record to execute DB command
I'm open for any improvement
Please create issue if you got a problem or an idea for enhancement