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
072e4351
Commit
072e4351
authored
May 27, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the way to set timestamp for multiple attributes.
parent
f1ce0e16
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
AutoTimestamp.php
framework/yii/behaviors/AutoTimestamp.php
+4
-4
No files found.
framework/yii/behaviors/AutoTimestamp.php
View file @
072e4351
...
@@ -83,17 +83,17 @@ class AutoTimestamp extends Behavior
...
@@ -83,17 +83,17 @@ class AutoTimestamp extends Behavior
*/
*/
public
function
updateTimestamp
(
$attributes
)
public
function
updateTimestamp
(
$attributes
)
{
{
$timestamp
=
$this
->
evaluateTimestamp
();
foreach
(
$attributes
as
$attribute
)
{
foreach
(
$attributes
as
$attribute
)
{
$this
->
owner
->
$attribute
=
$t
his
->
evaluateTimestamp
(
$attribute
)
;
$this
->
owner
->
$attribute
=
$t
imestamp
;
}
}
}
}
/**
/**
* Gets the appropriate timestamp for the specified attribute.
* Gets the current timestamp.
* @param string $attribute attribute name
* @return mixed the timestamp value
* @return mixed the timestamp value
*/
*/
protected
function
evaluateTimestamp
(
$attribute
)
protected
function
evaluateTimestamp
()
{
{
if
(
$this
->
timestamp
instanceof
Expression
)
{
if
(
$this
->
timestamp
instanceof
Expression
)
{
return
$this
->
timestamp
;
return
$this
->
timestamp
;
...
...
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