2007-09-02 18:24:49 +04:00
|
|
|
<?php
|
|
|
|
class ValidatorTest_AddressModel extends Doctrine_Record {
|
2008-02-04 00:29:57 +03:00
|
|
|
public static function initMetadata($class) {
|
|
|
|
$class->setColumn("id", "integer", 11, array('autoincrement' => true,
|
2007-09-02 18:24:49 +04:00
|
|
|
'primary' => true
|
|
|
|
));
|
2008-02-04 00:29:57 +03:00
|
|
|
$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'));
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
|
|
|
}
|