Download the PHP package inquid/yii2-relation-traits without Composer
On this page you can find all versions of the php package inquid/yii2-relation-traits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inquid/yii2-relation-traits
More information about inquid/yii2-relation-traits
Files in inquid/yii2-relation-traits
Package yii2-relation-traits
Short Description Yii 2 Models load with relation, & transaction save with relation for MongoDB
License BSD-3-Clause
Homepage http://github.com/inquid/yii2-mongo-relation-trait
Informations about the package yii2-relation-traits
yii2-relation-trait
Yii 2 Models add functionality for load with relation (loadAll($POST)), & transactional save with relation (saveAll())
PLUS soft delete/restore feature! For MongoDB!
Used in inquid/yii2-enhanced-gii
Support Mootnesai
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