Re: OOP Question in PHP
| From: | Ilker Cetinkaya | Date: | Thu, 06 Jun 2002 08:55:13 +0000 |
| Subject: | Re: OOP Question in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100903@lists.php.net to get a copy of this message | ||
"Scott Hurring" <scott@eacnet.com> wrote in message
news:7CD6B5C989DBD511ACF10090276AB707451BD3@rev-57.eac...
> Depends ;-)
yea, really depnds, but as you mentioned, having parameterless
constructors are more generic, especially when it comes to derive the
classes.
>
> instead (with option #2), you could do something like:
>
> // Create new document
> $d = new Document();
> // populate document
> $d->save();
>
> and
>
> // Get existing doc
> $d = new Document();
> $d->get(ID);
i'd advise method names load() (as for retrieve) and save() (as for store)