1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/tests_old/models/ValidatorTest_AddressModel.php
2008-02-08 17:41:01 +00:00

15 lines
843 B
PHP

<?php
class ValidatorTest_AddressModel extends Doctrine_Record {
public static function initMetadata($class) {
$class->setColumn("id", "integer", 11, array('autoincrement' => true,
'primary' => true
));
$class->setColumn('address1', 'string', 255, array('notnull' => true, 'notblank'));
$class->setColumn('address2', 'string', 255, array('notnull' => true));
$class->setColumn('city', 'string', 255, array('notnull' => true, 'notblank'));
$class->setColumn('state', 'string', 10, array('notnull' => true, 'notblank', 'usstate'));
$class->setColumn('zip', 'string', 15, array('notnull' => true, 'notblank', 'regexp' => '/^[0-9-]*$/'));
$class->hasMany('ValidatorTest_ClientModel', array('local' => 'address_id', 'foreign' => 'client_id', 'refClass' => 'ValidatorTest_ClientToAddressModel'));
}
}