/** * Update user last action. * * @param mixed $userId */ protected function _updateLastAction($userId) { $userId = (int) $userId; $timeNowDB = $this->_timeNowDB(); $this->__disableBehaviors(); $this->Cookie->write($this->_cookieName, $timeNowDB); $user = $this->_usersTable->get($userId); $user->last_action = $timeNowDB; $this->_usersTable->save($user); }