ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Ignore:
Timestamp:
Apr 5, 2009, 6:28:34 AM (13 years ago)
Author:
ebihara
Message:

#3765:imported new models for Doctrine from some old models for Propel to enable to login

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseCommunity.class.php

    r11208 r11219  
    66abstract class BaseCommunity extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('community');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    13     $this->hasColumn('file_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    14     $this->hasColumn('community_category_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('community');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     13        $this->hasColumn('file_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
     14        $this->hasColumn('community_category_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('File', array('local' => 'file_id',
    20                                 'foreign' => 'id'));
     16        $this->option('charset', 'utf8');
     17    }
    2118
    22     $this->hasOne('CommunityCategory', array('local' => 'community_category_id',
    23                                              'foreign' => 'id'));
     19    public function setUp()
     20    {
     21        $this->hasOne('File', array('local' => 'file_id',
     22                                    'foreign' => 'id'));
    2423
    25     $this->hasMany('CommunityMember', array('local' => 'id',
    26                                             'foreign' => 'community_id'));
     24        $this->hasOne('CommunityCategory', array('local' => 'community_category_id',
     25                                                 'foreign' => 'id'));
    2726
    28     $this->hasMany('CommunityConfig', array('local' => 'id',
    29                                             'foreign' => 'community_id'));
     27        $this->hasMany('CommunityMember', array('local' => 'id',
     28                                                'foreign' => 'community_id'));
    3029
    31     $timestampable0 = new Doctrine_Template_Timestampable();
    32     $this->actAs($timestampable0);
    33   }
     30        $this->hasMany('CommunityConfig', array('local' => 'id',
     31                                                'foreign' => 'community_id'));
     32
     33        $timestampable0 = new Doctrine_Template_Timestampable();
     34        $this->actAs($timestampable0);
     35    }
    3436}
Note: See TracChangeset for help on using the changeset viewer.