I have, what is probably a silly, question.

I want to convert my existing scripts to OO - because it's the "way to go"
in terms of the huge amount of functionality that they now have (and since
I've never done it before it would be interesting).  However I have one
thing that I don't understand.

My scripts manipulate documents and these documents are stored in a MySQL

To create a new object is really easy.  However, since I have lots of
documents already, how do I alter one?

Do I create a new document and pass the primary key as it's a variable in

$document = new Document(number);

and have the constructor retrieve the appropriate data from MySQL and fill
the attribute variables.

Or do I do something like:

$document = new Document;
$document ->retrieve(number);

Which is the best and most "valid" way of doing things.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to