'id', 'autoIncrement' => 'true', 'type' => 'INTEGER' ); /** * Copy the behavior to the database tables * Only for tables that have no Pk */ public function modifyDatabase() { foreach ($this->getDatabase()->getTables() as $table) { if(!$table->hasPrimaryKey()) { $b = clone $this; $table->addBehavior($b); } } } /** * Add the primary key to the current table */ public function modifyTable() { $table = $this->getTable(); if (!$table->hasPrimaryKey() && !$table->hasBehavior('concrete_inheritance')) { $columnAttributes = array_merge(array('primaryKey' => 'true'), $this->getParameters()); $this->getTable()->addColumn($columnAttributes); } } }