Skip to content

senor-artemisio/yii2-relation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Saving related data in Yii2

Build Status Latest Stable Version Total Downloads License

Behavior for support relational data management.

  • Insert related models from POST array.
  • Delete related models from database which not exist in POST array
  • Skip related models which already exist in database with same attributes
  • Rollback database changes, if relational model save/delete error occurred
  • Support one-to-one and one-to-many relations

This behavior uses getters for relational attribute in owner model, such getters must return ActiveQuery object. If you use string values in ON condition in ActiveQuery object, then this behavior will throw exception.

Installation

composer require notamedia/yii2-relation

About

Behavior for support relational data management

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%