protected function getUpdateFields($oldItem, $params) { /*{{{*/ $updateFields = array(); foreach ($oldItem as $key => $value) { if (isset($params[$key])) { if ($params[$key] != $oldItem[$key]) { $updateFields[$key] = $params[$key]; } } } if (!empty($updateFields)) { if (!isset($updateFields['edit_time'])) { $updateFields['edit_time'] = \Vine\Component\Tool\Toolbox::getNowDate(); } } return $updateFields; }
/** * Get raw sid * * @return string */ public function getRawSid() { /*{{{*/ $rawSid = $this->get(self::KEY_RAW_SID); if ('' == $rawSid) { list($usec, $sec) = explode(' ', microtime()); $sidData[] = \Vine\Component\Tool\Toolbox::getIp(); $sidData[] = \Vine\Component\Tool\Toolbox::getPort(); $sidData[] = $sec; $sidData[] = number_format((double) $usec, 3) * 1000; $sidData[] = rand(0, 999); $rawSid = implode(',', $sidData); $this->setRawSid($rawSid); } return $rawSid; }