Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] PropelResultset Iterator

propel
Discussion topic

Back to topic list

Re: [propel-dev] PropelResultset Iterator

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-10-04 07:56:14 PDT
Message Isn't Sven saying that FETCH_INTO will keep memory/resource use to a
minimum? (Unlike current situation where you would have a new object
allocated for each row returned.)

Hans

Alan Pinstein wrote:
> But you still didn't answer my question? What is the benefit or
> appropriate use of FETCH_INTO that otherwise wouldn't work? Why is it
> needed at all?
>
> Alan
>
> On Oct 4, 2006, at 10:48 AM, Sven Tietje wrote:
>
>> Alan Pinstein wrote:
>>
>> hi alan,
>>
>>> Eeeew. FETCH_INTO sounds awful. I cringe at the idea of how
>>> many bugs
>>> this causes with people not understanding references enough and
>>> having FETCH_INTO cause terrible problems. It's 2006, we don't need
>>> to re-use object shells! That is so not OO I don't even know how to
>>> express it.
>>>
>>> FETCH_INTO seems like some odd hack around GC unless I am not seeing
>>> something.
>>>
>>> Why is it needed?
>>
>> Ok... You are not a friend of FETCH_INTO - just mentioned it for
>> reading and
>> as possible option. If you know what it means: use it, where you need.
>>
>> By default propel should create a new instance for each row.
>>
>>> print "Querying for all properties to geocode...";
>>> $c = new Criteria;
>>> $c->add(MlsPrope​rtyPeer::GEOCODE_SCO​RE, 0); // only encode non-scored
>>> items
>>> $allPropsRS = MlsPropertyPeer::doS​electRS($c);
>>> print "Done!\n";
>>
>>> $rowCount = 0;
>>> $propArr = array();
>>> while ($allPropsRS->next()) {
>>> $prop = new MlsProperty;
>>> $prop->hydrate($allPropsRS);
>>> // do stuff
>>> $rowCount++;
>>> }
>>
>> Yes, of course it works, but i`m a friend of comfort :D Having a
>> resultset
>> and option to set is nice :D
>>
>> $rs = MlsPropertyPeer::doSelect($c);
>> // now just wanna read with some special calculation functions
>> $rs->setMode(Pro​pel::ONE_OBJECT /*FETCH_INTO*/);
>>
>> foreach ($rs as $row) {
>> //do stuff
>> }
>>
>> Of course, the iterator can work internally the way you mentioned above.
>>
>> Was just an idea to discuss. What do you think of using FETCH_CLASS?
>>
>> Alan, i am not against your hydrate-method - just wanna discuss the
>> implementation of pdo-features.
>>
>> Greets sven
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>

« Previous message in topic | 9 of 26 | Next message in topic »

Messages

Show all messages in topic

PropelResultset Iterator Sven Tietje <tietje at topconcepts dot de> Sven Tietje <tietje at topconcepts dot de> 2006-10-02 01:43:05 PDT
     Re: [propel-dev] PropelResultset Iterator =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-10-02 02:04:45 PDT
     Re: [propel-dev] PropelResultset Iterator =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-10-03 05:13:38 PDT
         Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-03 06:07:14 PDT
         RE: [propel-dev] PropelResultset Iterator Sven Tietje <tietje at topconcepts dot de> Sven Tietje <tietje at topconcepts dot de> 2006-10-04 02:56:24 PDT
             Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 07:15:25 PDT
                 RE: [propel-dev] PropelResultset Iterator Sven Tietje <tietje at topconcepts dot de> Sven Tietje <tietje at topconcepts dot de> 2006-10-04 07:48:00 PDT
                     Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 07:52:18 PDT
                         Re: [propel-dev] PropelResultset Iterator hlellelid Hans Lellelid 2006-10-04 07:56:14 PDT
                             Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 07:58:28 PDT
                             Re: [propel-dev] PropelResultset Iterator =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-10-04 08:00:10 PDT
                                 Re: [propel-dev] PropelResultset Iterator hlellelid Hans Lellelid 2006-10-04 08:05:23 PDT
                                     Re: [propel-dev] PropelResultset Iterator hlellelid Hans Lellelid 2006-10-04 08:09:56 PDT
                                         Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 08:15:54 PDT
                                             Re: [propel-dev] PropelResultset Iterator hlellelid Hans Lellelid 2006-10-04 08:19:39 PDT
                             RE: [propel-dev] PropelResultset Iterator Sven Tietje <tietje at topconcepts dot de> Sven Tietje <tietje at topconcepts dot de> 2006-10-04 08:06:19 PDT
                                 Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 08:25:56 PDT
                                     Re: [propel-dev] PropelResultset Iterator =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-10-04 08:31:18 PDT
                                     Re: [propel-dev] PropelResultset Iterator Sven Tietje <mail at sven-tietje dot de> Sven Tietje <mail at sven-tietje dot de> 2006-10-04 11:11:24 PDT
                                         Re: [propel-dev] PropelResultset Iterator =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-10-04 11:20:35 PDT
                                             Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 11:29:47 PDT
                                                 Re: [propel-dev] PropelResultset Iterator Sven Tietje <mail at sven-tietje dot de> Sven Tietje <mail at sven-tietje dot de> 2006-10-04 12:26:37 PDT
                                                     Re: [propel-dev] PropelResultset Iterator Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-10-04 12:47:23 PDT
             Re: [propel-dev] PropelResultset Iterator =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-10-04 07:57:22 PDT
                 RE: [propel-dev] PropelResultset Iterator Sven Tietje <tietje at topconcepts dot de> Sven Tietje <tietje at topconcepts dot de> 2006-10-04 08:11:30 PDT
Page: of 2 « Previous | Next »
Messages per page: