Database Object

Database Object

am 25.09.2007 05:57:33 von Supri anto

dear all,

straight to the point... i have this class

class Contract
{
private $id;
private $date;
private $c_number;

-- setter and getter --
}

class ContractCME extends Contract
{
private $tower_height;
private $shelter;
-- setter and getter --
}


class ContractCMD extends Contract
{
private $type;
private $brand;
-- setter and getter --
}

ok, both CME and CMD are contract, but differ in it's content, one is
tower and other is microwave. how to put the class into database ?
should i made a contract table , a cme and cmd one... ? any suggestion
?
--
Jangan tanyakan apa yang Indonesia telah berikan pada mu
tapi bertanyalah apa yang telah engkau berikan kepada Indonesia

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GU/IT d- s: a-- C++ UL P L++ E W++ N* o-- K-
w PS Y-- PGP- t++ 5 X R++ tv b+ DI D+ G e+ h* r- z?
------END GEEK CODE BLOCK------

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

Re: Database Object

am 25.09.2007 06:24:04 von dmagick

> ok, both CME and CMD are contract, but differ in it's content, one is
> tower and other is microwave. how to put the class into database ?
> should i made a contract table , a cme and cmd one... ? any suggestion
> ?

I'd have two tables because they are separate data relationships. One
for towers, one for microwaves.

Why would you need to keep the id's & dates separate to the other
information? Wouldn't each entity have a separate id (date's can
obviously be the same) ?

--
Postgresql & php tutorials
http://www.designmagick.com/

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