Object of class UserInbox could not be converted to string
Posted: Thu Apr 03, 2008 7:15 pm
I KEEP GETTING THIS ERROR when adding a record. Please advice.
Catchable fatal error: Object of class UserInbox could not be converted to string in C:\wamp\ZendFramework-1.0.4\library\Zend\Db\Statement\Pdo.php on line 221
<?php
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';
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();
$table->insert($data);
}
}
?>
Catchable fatal error: Object of class UserInbox could not be converted to string in C:\wamp\ZendFramework-1.0.4\library\Zend\Db\Statement\Pdo.php on line 221
<?php
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';
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();
$table->insert($data);
}
}
?>