Download the PHP package roaresearch/yii2-rmdb without Composer

On this page you can find all versions of the php package roaresearch/yii2-rmdb. 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-rmdb

Yii2 RMDB Classes

Library with migrations and models to easily create RMDB tables and models.

Installation

You can use composer to install the library roaresearch/yii2-rmdb by running the command;

composer require roaresearch/yii2-rmdb

or edit the composer.json file

Usage

Create Migrations

There are 3 migration classes for each type of RMDB tables.

roaresearch\yii2\rmdb\migrations\CreatePivot

Uses the properties $createdByColumn, $createdAtColumn and methods createdByDefinition(), createdAtDefinition() to store the user and datetime a record was created.

roaresearch\yii2\rmdb\migrations\CreateEntity

Extends the previous class adding the properties $updatedByColumn, $updatedAtColumn and methods updatedByDefinition(), updatedAtDefinition() to store the user and datetime a record was updated.

roaresearch\yii2\rmdb\migrations\CreatePersistentEntity

A persistent entity remains stored in the database after the user deletes it.

The library yii2tech/ar-softdelete provides support for this functionality.

CreateEntity extends the previous class adding the properties $deletedByColumn, $deletedAtColumn and methods deletedByDefinition(), deletedAtDefinition() to store the user and datetime a record was deleted.

RMDB Module

This library uses a custom module to help configure all the extended models in an homologued way.

configure it in your common\config\main.php in yii-app-advanced and common\config.php in yii-app-basic.

Models

Like the migrations there are 3 classes for models.

roaresearch\yii2\rmdb\models\Pivot

Adds protected properties $createdByAttribute and $createdAtAttribute to configure the names of the attributes. The class will automatically load the needed behaviors and configure them to use the attributes as provided by this properties.

roaresearch\yii2\rmdb\models\Entity

Extends the previous class and adds protected properties $updatedByAttribute and $updatedAtAttribute to configure the names of the attributes. The class will automatically load the needed behaviors and configure them to use the attributes as provided by this properties.

roaresearch\yii2\rmdb\models\PersistentEntity

Extends the previous class and adds protected properties $deletedByAttribute and $deletedAtAttribute to configure the names of the attributes. The class will automatically load the needed behaviors and configure them to use the attributes as provided by this properties.

This model uses the SoftDeleteActiveQuery class which add 2 methods to filter based on the deletion status of a record.

This methods will use columns $deletedByAttribute and $deletedByAttribute to determine if a record was soft deleted or not. To prevent conflicts in joins the attributes are normalized with the query alias. For this reason the alias() method must be called before the deleleted() or notDeleted().

Testing Environment

This library use Composer Utils to quickly deploy the needed database and testing Environment.

This will ask db credentials, validate them and create the needed database and structure.


All versions of yii2-rmdb with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1
roaresearch/yii2-migrate Version ~3.0.0
yiisoft/yii2 Version ~2.0.27
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 roaresearch/yii2-rmdb contains the following files

Loading the files please wait ....