Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2bootstrap
Project
Project
Details
Activity
Releases
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
夏彬
yii2bootstrap
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
Changes
1
Hide 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
*/
public
function
updateTimestamp
(
$attributes
)
{
$timestamp
=
$this
->
evaluateTimestamp
();
foreach
(
$attributes
as
$attribute
)
{
$this
->
owner
->
$attribute
=
$t
his
->
evaluateTimestamp
(
$attribute
)
;
$this
->
owner
->
$attribute
=
$t
imestamp
;
}
}
/**
* Gets the appropriate timestamp for the specified attribute.
* @param string $attribute attribute name
* Gets the current timestamp.
* @return mixed the timestamp value
*/
protected
function
evaluateTimestamp
(
$attribute
)
protected
function
evaluateTimestamp
()
{
if
(
$this
->
timestamp
instanceof
Expression
)
{
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