Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Fixing #20, added the missing userId for the exists() call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Aug 4, 2015
1 parent e113d95 commit 1a08f54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Model/Behavior/UserBehavior.php
Expand Up @@ -170,7 +170,9 @@ public function expirationTime($time = '+1 day', $dateFormat = 'Y-m-d H:i:s') {
*/
public function updateLastActivity($userId = null, $field = 'last_action', $options = []) {
$options = Hash::merge($this->_config['updateLastActivity'], $options);
if ($this->_table->exists([$this->_table->alias() . '.' . $this->_table->primaryKey()])) {
if ($this->_table->exists([
$this->_table->alias() . '.' . $this->_table->primaryKey() => $userId
])) {
return $this->_table->updateAll(
[$field => date($options['dateFormat'])],
[$this->_table->primaryKey() => $userId]
Expand Down

0 comments on commit 1a08f54

Please sign in to comment.