note 101081 added to pdostatement.fetch

From: Date: Wed, 24 Nov 2010 23:10:28 +0000
Subject: note 101081 added to pdostatement.fetch
Groups: php.notes 
Request: Send a blank email to php-notes+get-174338@lists.php.net to get a copy of this message
When fetching an object, the constructor of the class is called after the fields are populated by default. PDO::FETCH_PROPS_LATE is used to change the behaviour and make it work as expected - constructor be called _before_ the object fields will be populated with the data. sample: $a = $PDO->query('select id from table'); $a->setFetchMode(PDO::FETCH_CLASS|PDO::FETCH_PROPS_LATE, 'ClassName'); $obj = $a->fetch(); http://bugs.php.net/bug.php?id=53394 ---- Server IP: 69.147.83.197 Probable Submitter: 178.94.9.50 ---- Manual Page -- http://www.php.net/manual/en/pdostatement.fetch.php Edit -- https://master.php.net/note/edit/101081 Del: integrated -- https://master.php.net/note/delete/101081/integrated Del: useless -- https://master.php.net/note/delete/101081/useless Del: bad code -- https://master.php.net/note/delete/101081/bad+code Del: spam -- https://master.php.net/note/delete/101081/spam Del: non-english -- https://master.php.net/note/delete/101081/non-english Del: in docs -- https://master.php.net/note/delete/101081/in+docs Del: other reasons-- https://master.php.net/note/delete/101081 Reject -- https://master.php.net/note/reject/101081 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#174338) next »