Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ You can install this plugin into your CakePHP application using [composer](http:

Update your composer file to include this plugin:

```
```bash
composer require pgbi/cakephp3-soft-delete "~1.0"
```

## Configuration

### Load the plugin:
```
```php
// In /config/bootstrap.php
Plugin::load('SoftDelete');
```
### Make a model soft deleteable:

Use the SoftDelete trait on your model Table class:

```
```php
// in src/Model/Table/UsersTable.php
...
use SoftDelete\Model\Table\SoftDeleteTrait;
Expand Down Expand Up @@ -103,7 +103,7 @@ $success = $this->hardDelete($user);

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

```
```php
// in src/Model/Table/UsersTable.php
$date = new \DateTime('some date');
$affectedRowsCount = $this->hardDeleteAll($date);
Expand Down