setTableName('page'); $this->hasColumn('id', 'integer', null, array( 'type' => 'integer', 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('parent_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('region_id', 'integer', null, array( 'type' => 'integer', )); $this->hasColumn('title', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => '255', )); $this->hasColumn('description', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('content', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('can_edit', 'boolean', null, array( 'type' => 'boolean', 'default' => 0, )); $this->hasColumn('can_delete', 'boolean', null, array( 'type' => 'boolean', 'default' => 0, )); $this->hasColumn('can_subpage', 'boolean', null, array( 'type' => 'boolean', 'default' => 0, )); $this->hasColumn('seq', 'integer', null, array( 'type' => 'integer', 'default' => '1000', )); $this->option('type', 'InnoDB'); $this->option('collate', 'utf8_unicode_ci'); $this->option('charset', 'utf8'); } public function setUp() { $this->hasOne('Page', array( 'local' => 'parent_id', 'foreign' => 'id')); $this->hasOne('Region', array( 'local' => 'region_id', 'foreign' => 'id')); $this->hasMany('Page as SubPages', array( 'local' => 'id', 'foreign' => 'parent_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $sluggable0 = new Doctrine_Template_Sluggable(array( 'fields' => array( 0 => 'parent_id', 1 => 'title', ), 'unique' => true, )); $this->actAs($timestampable0); $this->actAs($sluggable0); } }