Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4ad0b9a3
Commit
4ad0b9a3
authored
May 17, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed to insert_time.
parent
84fe426c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
AutoTimestamp.php
yii/behaviors/AutoTimestamp.php
+3
-3
No files found.
yii/behaviors/AutoTimestamp.php
View file @
4ad0b9a3
...
@@ -28,7 +28,7 @@ use yii\db\ActiveRecord;
...
@@ -28,7 +28,7 @@ use yii\db\ActiveRecord;
* }
* }
* ~~~
* ~~~
*
*
* By default, AutoTimestamp will fill the `
create
_time` attribute with the current timestamp
* By default, AutoTimestamp will fill the `
insert
_time` attribute with the current timestamp
* when the associated AR object is being inserted; it will fill the `update_time` attribute
* when the associated AR object is being inserted; it will fill the `update_time` attribute
* with the timestamp when the AR object is being updated.
* with the timestamp when the AR object is being updated.
*
*
...
@@ -42,11 +42,11 @@ class AutoTimestamp extends Behavior
...
@@ -42,11 +42,11 @@ class AutoTimestamp extends Behavior
* The array keys are the ActiveRecord events upon which the attributes are to be filled with timestamps,
* The array keys are the ActiveRecord events upon which the attributes are to be filled with timestamps,
* and the array values are the corresponding attribute to be updated. You can use a string to represent
* and the array values are the corresponding attribute to be updated. You can use a string to represent
* a single attribute, or an array to represent a list of attributes.
* a single attribute, or an array to represent a list of attributes.
* The default setting is to update the `
create
_time` attribute upon AR insertion,
* The default setting is to update the `
insert
_time` attribute upon AR insertion,
* and update the `update_time` attribute upon AR updating.
* and update the `update_time` attribute upon AR updating.
*/
*/
public
$attributes
=
array
(
public
$attributes
=
array
(
ActiveRecord
::
EVENT_BEFORE_INSERT
=>
'
create
_time'
,
ActiveRecord
::
EVENT_BEFORE_INSERT
=>
'
insert
_time'
,
ActiveRecord
::
EVENT_BEFORE_UPDATE
=>
'update_time'
,
ActiveRecord
::
EVENT_BEFORE_UPDATE
=>
'update_time'
,
);
);
/**
/**
...
...
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