+ added some other placeholders, one for enum fields and one for simple indexes
[vsc.git] / _res / _libs / models / foo / indexes / fookeyindex.class.php
blobbc78af3e7d4d5af3863013898855a2d5fc2dfff8
1 <?php
2 /**
3 * @package ts_models
4 * @author Marius Orcsik <marius@habarnam.ro>
5 * @date 09.04.27
6 */
8 class fooKeyIndex extends fooIndexA {
9 public function __construct ($mIncomingStuff) {
10 /* @var $oField fooFieldA */
11 foreach ($mIncomingStuff as $oField) {
12 // enforcing NOT NULL constraints on the components of the primary key
13 if (fooFieldA::isValid($oField)) {
14 $oField->setIsNullable(false);
15 $aRet[] = $oField;
16 } else {
17 throw new fooIndexException('The object passed can not be used as a primary key.');
20 parent::__construct($aRet);
23 public function getName () {
24 return $this->name;
27 public function setName ($sName) {
28 $this->name = $sName . '_idx';
31 public function getType() {
32 return 'INDEX';
35 public function getDefinition () {
36 // this is totally wrong for PostgreSQL
37 return 'INDEX ' . $this->getName() . ' (' . $this->getIndexComponents(). ')';