Download the PHP package deadmantfa/yii2-relation-trait without Composer

On this page you can find all versions of the php package deadmantfa/yii2-relation-trait. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-relation-trait

yii2-relation-trait

Note: This is not the official extension by @mootensai.
I am not the creator of the original extension. I have made bug fixes and improvements that suit my use case.
Feel free to use it or refer to the official package at mootensai/yii2-relation-trait.

Yii 2 Models add functionality for loading related models via loadAll($POST) and transactional saving via saveAll().
It also supports soft delete and soft restore features.

Works best with mootensai/yii2-enhanced-gii.

Badges

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

Installation

The preferred way to install this extension is through Composer.

Either run

or add

to the require section of your application's file.

Usage in the Model

Controller Usage

The extension expects a normal array of POST data. For example:

In your controller:

Features

  1. Transaction Support a. Your data changes are atomic (ACID compliant).
  2. Normal a. Behaviors still work as usual since it’s built on top of Yii’s .
  3. Validation a. Errors from related models appear via , e.g.

  4. UUID or Auto-Increment Works with any PK strategy, including mootensai/yii2-uuid-behavior.
  5. Soft Delete By defining in your model constructor (and for restoring), you can softly mark rows as deleted instead of physically removing them.

Array Outputs

Produces a POST-like structure with the main model and related arrays.

Produces a nested structure under .

Contributing or Reporting Issues

Please open an issue or submit a PR if you find a bug or have an improvement idea.


Disclaimer

This package is a fork or an alternative to mootensai/yii2-relation-trait. All credit to @mootensai for the initial code. This is not meant to replace the original package but rather provide bug fixes and enhancements under a different namespace.


All versions of yii2-relation-trait with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
yiisoft/yii2 Version ^2.0.51
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package deadmantfa/yii2-relation-trait contains the following files

Loading the files please wait ...