Closed (won't fix)
Project:
PHPIDS
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2008 at 03:53 UTC
Updated:
17 Apr 2008 at 22:34 UTC
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
Comment #1
swentel commentedWhat has this todo with phpids ?
I don't recognize this code - it's not in my module, nor in the IDS package itself.
Comment #2
swentel commented