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
72ffb07e
Commit
72ffb07e
authored
Feb 03, 2015
by
Владимир Янц
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fix
parent
80a4fe9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
SoftDelete.php
SoftDelete.php
+5
-5
No files found.
SoftDelete.php
View file @
72ffb07e
...
...
@@ -11,7 +11,7 @@ use yii\db\ActiveRecord;
* Class SoftDelete
*
* @package vendor\vyants\softdelete
* @author Vladimir Yants <v
yants@dengisrazy.ru
>
* @author Vladimir Yants <v
ladimir.yants@gmail.com
>
* @property ActiveRecord $owner
*/
class
SoftDelete
extends
Behavior
...
...
@@ -51,8 +51,8 @@ class SoftDelete extends Behavior
* @param Event $event
*/
public
function
softDelete
(
$event
)
{
$attributes
[
0
]
=
$this
->
timeAttribute
;
if
(
$attributes
[
0
])
{
if
(
$this
->
timeAttribute
)
{
$attributes
[
0
]
=
$this
->
timeAttribute
;
$this
->
owner
->
$attributes
[
0
]
=
time
();
}
...
...
@@ -70,8 +70,8 @@ class SoftDelete extends Behavior
* Restore soft-deleted record
*/
public
function
restore
()
{
$attributes
[
0
]
=
$this
->
timeAttribute
;
if
(
$attributes
[
0
])
{
if
(
$this
->
timeAttribute
)
{
$attributes
[
0
]
=
$this
->
timeAttribute
;
$this
->
owner
->
$attributes
[
0
]
=
null
;
}
...
...
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