Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

"restore" records - Call to a member function restore() on null #9

Closed
WitekS opened this issue Oct 13, 2017 · 1 comment
Closed

"restore" records - Call to a member function restore() on null #9

WitekS opened this issue Oct 13, 2017 · 1 comment
Labels

Comments

@WitekS
Copy link

WitekS commented Oct 13, 2017

When I restore the record I get an error,

Call to a member function restore () on null

which is probably related to this. By using:

public static function find (){          return parent: find () -> where (['isDeleted' => false]);  }

for the record deleted
$item = Item :: findOne ($ id);
$item will be null
$item->restore(); // restore record
This way, you can not restore marked items as deleted

@klimov-paul
Copy link
Member

Default scope you apply to your model does not relate to this extension.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants