setTableName('estate'); $this->hasColumn('category_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('sub_category_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('type_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('change_user_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('broker_user_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('building_type_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('building_condition_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('object_type_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('price_unit_id', 'integer', null, array( 'type' => 'integer', 'notnull' => true, )); $this->hasColumn('ownership_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('name', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('description', 'clob', null, array( 'type' => 'clob', )); $this->hasColumn('price', 'double', null, array( 'type' => 'double', 'notnull' => true, )); $this->hasColumn('region_code', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('district', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('district_code', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('city', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('city_code', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('street', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => 255, )); $this->hasColumn('street_code', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('usable_area', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('estate_area', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('floor_number', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('sreality_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('synch_sreality', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => true, )); $this->hasColumn('reals_id', 'integer', null, array( 'type' => 'integer', 'notnull' => false, )); $this->hasColumn('synch_reals', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => true, )); $this->hasColumn('is_hidden', 'boolean', null, array( 'type' => 'boolean', 'notnull' => true, 'default' => false, )); $this->option('collate', 'utf8_czech_ci'); $this->option('charset', 'utf8'); } public function setUp() { parent::setUp(); $this->hasOne('Category', array( 'local' => 'category_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('SubCategory', array( 'local' => 'sub_category_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Type', array( 'local' => 'type_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('sfGuardUser as ChangeUser', array( 'local' => 'change_user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('sfGuardUser as BrokerUser', array( 'local' => 'broker_user_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('BuildingType', array( 'local' => 'building_type_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('BuildingCondition', array( 'local' => 'building_condition_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('ObjectType', array( 'local' => 'object_type_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('PriceUnit', array( 'local' => 'price_unit_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasOne('Ownership', array( 'local' => 'ownership_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); $this->hasMany('Image as Images', array( 'local' => 'id', 'foreign' => 'estate_id')); $this->hasMany('Attach as Attachs', array( 'local' => 'id', 'foreign' => 'estate_id')); $this->hasMany('Demand as Demands', array( 'local' => 'id', 'foreign' => 'estate_id')); $timestampable0 = new Doctrine_Template_Timestampable(); $sluggable0 = new Doctrine_Template_Sluggable(array( 'fields' => array( 0 => 'name', ), 'unique' => true, 'builder' => array( 0 => 'saInflector', 1 => 'urlize', ), )); $this->actAs($timestampable0); $this->actAs($sluggable0); } }