Reply to Re: Queries from inside classes

Your name:

Reply:


Posted by Dikkie Dik on 05/19/06 18:00

> I've got a class that builds a calendar for the current month. I have
> an extending class that adds links to all days in the calendar via
> browser querystring.
>
> My goal is to create links not to every single day, but only to days
> that satisfy a certain condition - very similar to blog calendars with
> posting dates highlighted. No post on that day - the date is not
> highlighted.
>
> I have to run a query from the extending class, which is totally new to
> me. Any pointers?
>
You don't have to run a query from the extending class at all. In fact,
I can't see it as the responsibility of a calender class to dig in a
database.

I think your extending class needs to be passed a links collection (or
array) in either the constructor or a setter.

It is the responsibility of the code that _calls_ the calendar to
provide the links list. This list may then come from memory, a database,
or wherever.

Best regards

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация