Re: class problem :(
| From: | Nathan Nobbe | Date: | Thu, 28 May 2009 22:46:24 +0000 |
| Subject: | Re: class problem :( | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293333@lists.php.net to get a copy of this message | ||
On Thu, May 28, 2009 at 4:28 PM, Luke <luke@blog-thing.com> wrote:
> Any ideas? Perhaps there is a different way I could implement the classes -
> I would rather not have getObjectIds repeated three times!
just make the classes instance-based, thats your easiest bet.
(sorry for the extra noise)
abstract class ForumObject
{
private $table;
function getObjectIds ($field, $value)
{
$query = "SELECT id FROM {$this->table} WHERE $field = '$value'";
$object_ids = mysql_fetch_array();
return $object_ids;
}
}
painful, i know.. which is why static inheritance is one of the headliners
in 5.3.
-nathan