Cake PHP 2 - Update question from new user

Hi,
I am fairly new to CakePHP, being handed a project that now needs some work. I want to update all notifications as read. I found code that updates one notification, which works fine:

public function markread($notificationId) {
		try {
			$notificationModel = ClassRegistry::init(array('class' => 'UserNotification'));
			$notificationModel->updateAll(array(
				'UserNotification.is_read' => self::NOTIFICATION_READ,
				'UserNotification.updated_at' => "'" . date('Y-m-d H:i:s') . "'",
			), array(
				'UserNotification.id' => $notificationId
			));
		} catch(Exception $e) {
			throw $e;
		}
	}

I now want an option to update ALL as read for a user id… I am using this but it is not updating anything. What have I missed?

public function markAllNotificationsAsRead($userId) {
		try {
			$notificationModel = ClassRegistry::init(array('class' => 'UserNotification'));
			$notificationModel->updateAll(
				array('UserNotification.is_read' => self::NOTIFICATION_READ,'UserNotification.updated_at' => "'" . date('Y-m-d H:i:s') . "'"),
				array('UserNotification.user_id' => $userId)
			);
		} catch(Exception $e) {
			throw $e;
		}
	}

See Class Model | CakePHP 2.10 on how that method works.

Thanks for the reply,
I will give this another go, but based on the existing code for markread($notificationId) - which works, I would have thought my new code for markAllNotificationsAsRead($userId) would work as well? First array being the fields to update and the second array being what to look for? (ie matching userId’s)?

I agree, it looks like it should. Are you 100% sure that $userId holds the data that you think it does?