Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author =?ISO-8859-1?Q?David_Z=FClke?= <dz@bitxtender.com>
Full name =?ISO-8859-1?Q?David_Z=FClke?= <dz@bitxtender.com>
Date 2006-10-02 02:04:45 PDT
Message Yeah that's one of the things I proposed for 2.0. That said, it's
probably better to put it there, not into 1.3. Opinions?

- David


Am 02.10.2006 um 10:43 schrieb Sven Tietje:

> Hi,
>
> i`d like to create a PropelResultset to make it possible to iterate
> over
> Resultsets and to hydrate objects on the fly. We have talked about it.
>
> One of propel`s performance problems are the Result-Arrays.
>
> $resultArrray = TablePeer::doSelect(new Criteria());
>
> doSelect queries the database. A Resultset is given. Now, Propel
> fetches
> each row of the resultset, hydrates the row into an object and puts
> the
> object into an array. Having fetched all rows, doSelect returns the
> array.
>
> I think BasePeer should return a PropelResultset.
>
> class PropelResultset implements IteratorAggregate, ArrayAccess,
> Countable {
> public function setFetchMode();
>
> .... Interface - Methods
> }
>
> - ArrayAccess and Countable will make PropelResultset
> backwards-compatible to the normal array.
>
> - setFetchMode will give you two possiblities:
>
> 1) PropelResultset::OBJECT - enabled by default
> $resultset->setF​etchMode(PropelResul​tset::OBJECT);
> foreach ($resultset as $item) {
> $item->getPrimaryKey();
> $item->set...;
> $item->save();
> }
>
> 2) PropelResultset::ARRAY - sometimes you don`t need objects
> $resultset->setF​etchMode(PropelResul​tset::ARRAY);
> foreach ($resultset as $item) {
> $item[TablePeer::ID];
> $item[TablePeer::TITLE];
> }
> Key of the $item - Array is of structure:
> tablename.columname or tablealias.columnname
>
> Perhaps we also should discuss a BaseObject implementing ArrayAccess
> directly.
>
>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>