PHP Трейт SoftDelete\Model\Table\SoftDeleteTrait

Показать файл Открыть проект

Открытые методы

Метод Описание
deleteAll ( $conditions ) : integer Soft deletes all records matching $conditions.
getSoftDeleteField ( ) : string Get the configured deletion field
hardDelete ( Cake\Datasource\EntityInterface $entity ) : boolean Hard deletes the given $entity.
hardDeleteAll ( Datetime $until ) : integer Hard deletes all records that were soft deleted before a given date.
query ( )
restore ( Cake\Datasource\EntityInterface $entity ) : boolean Restore a soft deleted entity into an active state.

Защищенные методы

Метод Описание
_processDelete ( Cake\DataSource\EntityInterface $entity, ArrayObject $options ) : boolean Perform the delete operation.

Описание методов

_processDelete() защищенный Метод

Will soft delete the entity provided. Will remove rows from any dependent associations, and clear out join tables for BelongsToMany associations.
protected _processDelete ( Cake\DataSource\EntityInterface $entity, ArrayObject $options ) : boolean
$entity Cake\DataSource\EntityInterface The entity to soft delete.
$options ArrayObject The options for the delete.
Результат boolean success

deleteAll() публичный Метод

Soft deletes all records matching $conditions.
public deleteAll ( $conditions ) : integer
Результат integer number of affected rows.

getSoftDeleteField() публичный Метод

Get the configured deletion field
public getSoftDeleteField ( ) : string
Результат string

hardDelete() публичный Метод

Hard deletes the given $entity.
public hardDelete ( Cake\Datasource\EntityInterface $entity ) : boolean
$entity Cake\Datasource\EntityInterface
Результат boolean true in case of success, false otherwise.

hardDeleteAll() публичный Метод

Hard deletes all records that were soft deleted before a given date.
public hardDeleteAll ( Datetime $until ) : integer
$until Datetime Date until which soft deleted records must be hard deleted.
Результат integer number of affected rows.

query() публичный Метод

public query ( )

restore() публичный Метод

Restore a soft deleted entity into an active state.
public restore ( Cake\Datasource\EntityInterface $entity ) : boolean
$entity Cake\Datasource\EntityInterface Entity to be restored.
Результат boolean true in case of success, false otherwise.