2007-09-02 18:24:49 +04:00
|
|
|
<?php
|
|
|
|
class QueryTest_Rank extends Doctrine_Record
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Initializes the table definition.
|
|
|
|
*/
|
2008-02-04 00:29:57 +03:00
|
|
|
public static function initMetadata($class)
|
2007-09-02 18:24:49 +04:00
|
|
|
{
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->setColumn('title as title', 'string', 100,
|
2007-09-02 18:24:49 +04:00
|
|
|
array('notnull'));
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->setColumn('color as color', 'string', 20,
|
2007-09-02 18:24:49 +04:00
|
|
|
array('notnull', 'regexp' => '/^[a-zA-Z\-]{3,}|#[0-9a-fA-F]{6}$/D'));
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->setColumn('icon as icon', 'string', 50,
|
|
|
|
array('notnull', 'default' => ' ', 'regexp' => '/^[a-zA-Z0-9_\-]+\.(jpg|gif|png)$/D'));
|
|
|
|
|
|
|
|
$class->hasMany('QueryTest_User as users', array('local' => 'rankId', 'foreign' => 'userId', 'refClass' => 'QueryTest_UserRank'));
|
2007-09-02 18:24:49 +04:00
|
|
|
}
|
|
|
|
}
|