Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yii2-softdelete
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
digisin
yii2-softdelete
Commits
80a4fe9a
Commit
80a4fe9a
authored
Feb 03, 2015
by
Владимир Янц
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unusable
parent
e5ee32e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
17 deletions
+0
-17
SoftDelete.php
SoftDelete.php
+0
-17
No files found.
SoftDelete.php
View file @
80a4fe9a
...
...
@@ -42,7 +42,6 @@ class SoftDelete extends Behavior
public
function
events
()
{
return
[
ActiveRecord
::
EVENT_BEFORE_DELETE
=>
'softDelete'
,
ActiveRecord
::
EVENT_BEFORE_FIND
=>
'filterDeleted'
];
}
...
...
@@ -67,22 +66,6 @@ class SoftDelete extends Behavior
$event
->
isValid
=
false
;
}
/**
* Set the attribute deleted
*
* @param Event $event
*/
public
function
filterDeleted
(
$event
)
{
$attributes
[
1
]
=
$this
->
statusAttribute
;
$this
->
owner
->
$attributes
[
1
]
=
$this
->
deletedValue
;
// save record
$this
->
owner
->
save
(
false
,
$attributes
);
//prevent real delete
$event
->
isValid
=
false
;
}
/**
* Restore soft-deleted record
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment