populating user specified objects like PDO uses? I am writing some tutorials
for Zend_Amf and the transfer objects are used all the time for sending data
back forth over the RPC call. When dealing directly with PDO you can specify
your fetch mode and class name that you want to populate.
$stmt = $pdo -> query('your query');
$stmt -> setFetchMode(PDO::FETCH_CLASS, 'yourClass', array(0 => false));
http://php.net/manual/en/pdostatement.setfetchmode.php
The zend db docs "15.1.3.2. Changing the Fetch Mode has Zend_Db::FETCH_OBJ
and says that the stdclass is used as "default" but it does not say how to
change it.
I looked at Zend_Db_Adapter_Pdo_Abstract->fetchMode and it only takes one
argument. Is it possible to use this PDO behavior?
Should I being doing this differently inside of Zend_Db for populating an
array of VO/DTO transfer objects?
--
View this message in context: http://www.nabble.com/Specifying-FetchClass-custom-class-in-Zend_DB---tp24083224p24083224.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论