4 * @author Marius Orcsik <marius@habarnam.ro>
8 abstract class fooIndexA
implements fooFieldI
{
10 protected $fields = array();
12 public function __construct ($mIncomingStuff = null) {
13 if (is_array ($mIncomingStuff)) {
14 $this->setName($mIncomingStuff[0]->getName());
15 foreach ($mIncomingStuff as $oField) {
16 if (fooFieldA
::isValid($oField))
17 $this->addField ($oField);
19 throw new fooIndexException ('The object passed can not be used as a primary key.');
22 throw new fooIndexException ('The data used to instantiate the table\'s primary key is invalid.');
26 // abstract public function getName ();
28 // abstract public function setName ($sName);
30 public function addField (fooFieldA
$oField) {
31 $this->fields
[$oField->getName()] = $oField;
34 // public function removeField (fooFieldA $oField) {
35 // if (isset ($this->fields[$oField->getName()]))
36 // unset($this->fields[$oField->getName()]);
39 public function getIndexComponents () {
40 return implode (', ', array_keys($this->fields
));