GETT THIS ERROR Object of class UserInbox could not be converted to string. Please help.

require_once('Zend/Date.php');

// this class fetches the private messages from the t_inbox table 
class UserInbox extends Zend_Db_Table 
{
	protected $_name = 't_inbox';

	// get all the messages in the zone	
	public function getPrivateMessages($receiverId) 
	{
		//TODO query
		$db = $this->getAdapter();
		$logger = Zend_Registry::get(YoConstants::REGKEY_LOGGER);
		
		$sql = 'select * from t_inbox i where i.receiver_id = '.$receiverId;
		return $db->fetchAll($sql);		
	}
	
	// add private messages for the receiver 
	public function postPrivateMessage($senderId, $receiverId, $zoneId, $sub, $msg, $msgType) 
	{
		$logger = Zend_Registry::get(YoConstants::REGKEY_LOGGER);
		
		$logger->debug('SUBJECT IS ' . $sub);
		$date = Zend_Date::now();
	
		$data = array(
						'sender_id' => $senderId,
						'receiver_id' => $receiverId,
						'zone_id' => $zoneId,
						'msgDate' => $date->toString,
						'message_type' => $msgType,						
						'message_text' => $msg,
						'subject' => $sub,						
						'msg_read' => 'no',
						'status' => '0'
					 );

		$table = new UserInbox();
		$logger->debug('DATE IS ' . $date);
		$table->insert($data);
		$logger->debug('DATE IS ' . $date);
	}
	
}

Comments

swentel’s picture

Status: Active » Postponed (maintainer needs more info)

What has this todo with phpids ?
I don't recognize this code - it's not in my module, nor in the IDS package itself.

swentel’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)