[dev] Scry last poll block optimisation

Jan Schneider jan at horde.org
Mon Oct 4 07:28:01 PDT 2004


Zitat von Duck <duck at obala.net>:

>
> Now that we can limit how many polls to fetch, we don't neet to get all polls
> data to select the last one. The patch limit the retriving to the first
> retuned poll.
>
> Then as we select the poll in the title of the block. We can "cache" the poll
> data in "this->_poll" so we can reuse id later in the _content block call.

You should put the poll fetching code into a separate method that uses a
static variable instead of a class member to cache the poll, because you
can't be sure that _title() gets always called before _content().

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the dev mailing list