From 072e4351e6f67a2a60b516e532286fcfed21b5b2 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 27 May 2013 14:27:37 -0400 Subject: [PATCH] Changed the way to set timestamp for multiple attributes. --- framework/yii/behaviors/AutoTimestamp.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/yii/behaviors/AutoTimestamp.php b/framework/yii/behaviors/AutoTimestamp.php index ea69963..7611712 100644 --- a/framework/yii/behaviors/AutoTimestamp.php +++ b/framework/yii/behaviors/AutoTimestamp.php @@ -83,17 +83,17 @@ class AutoTimestamp extends Behavior */ public function updateTimestamp($attributes) { + $timestamp = $this->evaluateTimestamp(); foreach ($attributes as $attribute) { - $this->owner->$attribute = $this->evaluateTimestamp($attribute); + $this->owner->$attribute = $timestamp; } } /** - * 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;