Download the PHP package kakaeriel/cakephp3-soft-delete without Composer

On this page you can find all versions of the php package kakaeriel/cakephp3-soft-delete. 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 cakephp3-soft-delete

CakeSoftDelete plugin for CakePHP

Purpose

This Cakephp plugin enables you to make your models soft deletable. When soft deleting an entity, it is not actually removed from your database. Instead, a deleted timestamp is set on the record.

Requirements

This plugins has been developed for cakephp 3.x.

Installation

You can install this plugin into your CakePHP application using composer.

Update your composer file to include this plugin:

Configuration

Load the plugin:

Make a model soft deleteable:

Use the SoftDelete trait on your model Table class:

Your soft deletable model database table should have a field called deleted of type DateTime with NULL as default value. If you want to customise this field you can declare the field in your Table class.

Use

Soft deleting records

delete and deleteAll functions will now soft delete records by populating deleted field with the date of the deletion.

Restoring Soft deleted records

To restore a soft deleted entity into an active state, use the restore method:

Finding records

find, get or dynamic finders (such as findById) will only return non soft deleted records. To also return soft deleted records, $options must contain 'withDeleted'. Example:

Hard deleting records

To hard delete a single entity:

To mass hard delete records that were soft deleted before a given date, you can use hardDeleteAll($date):

Soft deleting & associations

Associations are correctly handled by SoftDelete plugin.

  1. Soft deletion will be cascaded to related models as usual. If related models also use SoftDelete Trait, they will be soft deleted.
  2. Soft deletes records will be excluded from counter caches.

All versions of cakephp3-soft-delete with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
cakephp/plugin-installer Version *
cakephp/cakephp Version ~3.4
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 kakaeriel/cakephp3-soft-delete contains the following files

Loading the files please wait ....