public function markAsRead()
	{
		if (!$this->get('id'))
		{
			$this->addError('Recipient record not found');
			return false;
		}

		$xseen = Seen::oneByMessageAndUser($this->get('mid'), $this->get('uid'));

		if ($xseen->get('whenseen') == ''
		 || $xseen->get('whenseen') == '0000-00-00 00:00:00'
		 || $xseen->get('whenseen') == null)
		{
			$dt = new Date('now');

			$xseen->set('mid', $this->get('mid'));
			$xseen->set('uid', $this->get('uid'));
			$xseen->set('whenseen', $dt->toSql());
			if (!$xseen->save())
			{
				$this->addError($xseen->getError());
				return false;
			}
		}

		return true;
	}
public function markAsRead()
	{
		if (!$this->get('id'))
		{
			$this->addError('Recipient record not found');
			return false;
		}

		$xseen = Seen::oneByMessageAndUser($this->get('mid'), $this->get('uid'));

		if ($xseen->get('whenseen') == ''
		 || $xseen->get('whenseen') == '0000-00-00 00:00:00'
		 || $xseen->get('whenseen') == null)
		{
			$dt = new Date('now');

			$xseen->set('mid', $this->get('mid'));
			$xseen->set('uid', $this->get('uid'));
			$xseen->set('whenseen', $dt->toSql());
			if (!$xseen->save())
			{
				$this->addError($xseen->getError());
				return false;
			}
		}

		return true;
	}
public function markAsRead ( ) { if ( ! $ this -> get ( 'id' ) ) { $ this -> addError ( 'Recipient record not found' ) ; return false ; } $ xseen = Seen :: oneByMessageAndUser ( $ this -> get ( 'mid' ) , $ this -> get ( 'uid' ) ) ; if ( $ xseen -> get ( 'whenseen' ) == '' || $ xseen -> get ( 'whenseen' ) == '0000-00-00 00:00:00' || $ xseen -> get ( 'whenseen' ) == null ) { $ dt = new Date ( 'now' ) ; $ xseen -> set ( 'mid' , $ this -> get ( 'mid' ) ) ; $ xseen -> set ( 'uid' , $ this -> get ( 'uid' ) ) ; $ xseen -> set ( 'whenseen' , $ dt -> toSql ( ) ) ; if ( ! $ xseen -> save ( ) ) { $ this -> addError ( $ xseen -> getError ( ) ) ; return false ; } } return true ; }
Mark a message as being read by the recipient

@return  boolean  True on success
Mark a message as being read by the recipient