Download the PHP package andmemasin/yii2-myabstract without Composer

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

Yii2-Myabstracts

build

Soft delete schema

This major version uses Laravel-style soft-delete timestamp semantics by default.

Default lifecycle columns:

Default audit columns:

Active records have deleted_at IS NULL. Deleted records have deleted_at set to the deletion timestamp.

This package keeps timestamp values as DATETIME(6) / Y-m-d H:i:s.u values. Laravel's migration helpers commonly create SQL TIMESTAMP columns for created_at, updated_at, and deleted_at, but that is not a UNIX integer timestamp. Both DATETIME(6) and TIMESTAMP(6) are read by Laravel/Eloquent as date objects.

The practical difference is timezone handling: MySQL DATETIME stores the exact calendar value written, while MySQL TIMESTAMP can be converted according to the DB session timezone. Keeping DATETIME(6) avoids timezone surprises during the Yii-to-Laravel transition. A future schema cleanup may convert these columns to TIMESTAMP(6) if strict Laravel migration-helper compatibility becomes more important than preserving current DB behavior.

Apps that still use the previous columns must override the column-name properties on their models until their own migrations are complete:

Overrides only change column names. They do not preserve the old end-of-time active-row convention; active rows must still have the configured deleted timestamp column set to NULL.

Junction relations in 10.x

Raw viaTable() calls are rejected because a table-name string cannot identify soft-delete behavior. Use an explicit junction ActiveRecord class:

using() derives the table from Response::tableName(). When the junction extends MyActiveRecord and logical deletion is enabled, its deleted_at IS NULL condition is added automatically.

Migrating an app module to 9.x

Migrate one app module or table group at a time.

  1. Update the module package constraint to allow andmemasin/yii2-myabstract:^9.
  2. Add a DB migration that renames the columns:

  3. Convert active rows to the new Laravel-style soft-delete state:

Use dateTime(6) for this migration phase unless the module explicitly decides to also take on timezone semantics changes. Do not convert to UNIX integer timestamps.

  1. Replace indexes that include user_closed with equivalent indexes using deleted_at.
  2. Remove old column-name overrides from migrated models.
  3. Keep explicit old-name overrides only on models whose tables are not migrated yet.
  4. Search the module for direct references to old names and update queries/search models/tests:

  5. Run the module tests and PHPStan before release:

Do not dual-write old and new columns. If a module cannot migrate its tables yet, keep it on the old major version or add explicit old-name overrides until that module gets its own migration.

Optional audit schema helper

MyAbstract provides andmemasin\myabstract\schema\AuditSchemaHelper for explicit schema maintenance in migrations or project-owned maintenance code.

It is not a console command and does not run automatically.

The helper only creates the current audit columns: created_by, updated_by, deleted_by, created_at, updated_at, and deleted_at.

It never creates legacy columns: user_created, user_updated, user_closed, time_created, time_updated, or time_closed.

The user table and auth/runtime tables are skipped by default. Old-column renames are still the owning module's migration responsibility.


All versions of yii2-myabstract with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3.0
yiisoft/yii2 Version ^2.0.14
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 andmemasin/yii2-myabstract contains the following files

Loading the files please wait ...