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

Changeset 11219


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

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

Location:
OpenPNE3/branches/goto_doctrine
Files:
4 added
69 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/goto_doctrine/apps/mobile_frontend/modules/default/actions/components.class.php

    r10277 r11219  
    1313  public function executeNav()
    1414  {
    15     $this->navs = NavigationPeer::retrieveByType($this->type);
     15    $this->navs = Doctrine::getTable('Navigation')->retrieveByType($this->type);
    1616  }
    1717
  • OpenPNE3/branches/goto_doctrine/apps/mobile_frontend/modules/member/actions/actions.class.php

    r11151 r11219  
    2626  {
    2727    $this->gadgetConfig = sfConfig::get('op_mobile_gadget_list');
    28     $this->mobileTopGadgets = GadgetPeer::retrieveMobileTopGadgets();
    29     $this->mobileContentsGadgets = GadgetPeer::retrieveMobileContentsGadgets();
    30     $this->mobileBottomGadgets = GadgetPeer::retrieveMobileBottomGadgets();
     28    $this->mobileTopGadgets = Doctrine::getTable('Gadget')->retrieveMobileTopGadgets();
     29    $this->mobileContentsGadgets = Doctrine::getTable('Gadget')->retrieveMobileContentsGadgets();
     30    $this->mobileBottomGadgets = Doctrine::getTable('Gadget')->retrieveMobileBottomGadgets();
    3131
    3232    $this->categories = sfConfig::get('openpne_member_category');
     
    8484      $this->passwordForm->bind($request->getParameter('password'));
    8585      if ($this->passwordForm->isValid()) {
    86         $memberConfig = MemberConfigPeer::retrieveByNameAndMemberId('mobile_uid', $this->getUser()->getMemberId());
     86        $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('mobile_uid', $this->getUser()->getMemberId());
    8787        if (!$memberConfig) {
    8888          $memberConfig = new MemberConfig();
     
    109109    $token = $request->getParameter('token');
    110110
    111     $memberConfig = MemberConfigPeer::retrieveByNameAndMemberId('register_mobile_token', $id);
     111    $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('register_mobile_token', $id);
    112112
    113113    $this->forward404Unless($memberConfig && $token === $memberConfig->getValue());
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/design/actions/actions.class.php

    r11209 r11219  
    6060  public function executeGadget(sfWebRequest $request)
    6161  {
    62     $this->type = $request->getParameter('type', GadgetPeer::HOME_TYPES);
    63     $this->gadgets = GadgetPeer::retrieveGadgetsByTypesName($this->type);
     62    $this->type = $request->getParameter('type', Doctrine::getTable('Gadget')::HOME_TYPES);
     63    $this->gadgets = Doctrine::getTable('Gadget')->retrieveGadgetsByTypesName($this->type);
    6464
    6565    $this->sortForm = new GadgetSortForm(array(), array('current_gadgets' => $this->gadgets));
     
    8686  {
    8787    $this->layoutPattern = 'layoutA';
    88     $this->topGadgets = (array)GadgetPeer::retrieveTopGadgets();
    89     $this->sideMenuGadgets = (array)GadgetPeer::retrieveSideMenuGadgets();
    90     $this->contentsGadgets = (array)GadgetPeer::retrieveContentsGadgets();
    91     $this->bottomGadgets = (array)GadgetPeer::retrieveBottomGadgets();
     88    $this->topGadgets = (array)Doctrine::getTable('Gadget')->retrieveTopGadgets();
     89    $this->sideMenuGadgets = (array)Doctrine::getTable('Gadget')->retrieveSideMenuGadgets();
     90    $this->contentsGadgets = (array)Doctrine::getTable('Gadget')->retrieveContentsGadgets();
     91    $this->bottomGadgets = (array)Doctrine::getTable('Gadget')->retrieveBottomGadgets();
    9292    $this->gadgetConfig = sfConfig::get('op_gadget_list');
    9393
     
    109109  {
    110110    $this->layoutPattern = 'layoutA';
    111     $this->topGadgets = (array)GadgetPeer::retrieveLoginTopGadgets();
    112     $this->sideMenuGadgets = (array)GadgetPeer::retrieveLoginSideMenuGadgets();
    113     $this->contentsGadgets = (array)GadgetPeer::retrieveLoginContentsGadgets();
    114     $this->bottomGadgets = (array)GadgetPeer::retrieveLoginBottomGadgets();
     111    $this->topGadgets = (array)Doctrine::getTable('Gadget')->retrieveLoginTopGadgets();
     112    $this->sideMenuGadgets = (array)Doctrine::getTable('Gadget')->retrieveLoginSideMenuGadgets();
     113    $this->contentsGadgets = (array)Doctrine::getTable('Gadget')->retrieveLoginContentsGadgets();
     114    $this->bottomGadgets = (array)Doctrine::getTable('Gadget')->retrieveLoginBottomGadgets();
    115115    $this->gadgetConfig = sfConfig::get('op_login_gadget_list');
    116116
     
    131131  public function executeAddGadget(sfWebRequest $request)
    132132  {
    133     $this->type = $request->getParameter('type', GadgetPeer::TOP_TYPE);
    134     $this->config = GadgetPeer::getGadgetConfigListByType($this->type);
     133    $this->type = $request->getParameter('type', Doctrine::getTable('Gadget')::TOP_TYPE);
     134    $this->config = Doctrine::getTable('Gadget')->getGadgetConfigListByType($this->type);
    135135
    136136    return sfView::SUCCESS;
     
    144144  public function executeEditGadget(sfWebRequest $request)
    145145  {
    146     $this->gadget = GadgetPeer::retrieveByPK($request->getParameter('id'));
     146    $this->gadget = Doctrine::getTable('Gadget')->find($request->getParameter('id'));
    147147
    148148    $type = $this->gadget->getType();
    149     $config = GadgetPeer::getGadgetConfigListByType($type);
     149    $config = Doctrine::getTable('Gadget')->getGadgetConfigListByType($type);
    150150
    151151    $this->forward404Unless($this->gadget && $config);
     
    177177  public function executeMobileHomeGadgetPlot(sfWebRequest $request)
    178178  {
    179     $this->mobileTopGadgets = (array)GadgetPeer::retrieveMobileTopGadgets();
    180     $this->mobileContentsGadgets = (array)GadgetPeer::retrieveMobileContentsGadgets();
    181     $this->mobileBottomGadgets = (array)GadgetPeer::retrieveMobileBottomGadgets();
     179    $this->mobileTopGadgets = (array)Doctrine::getTable('Gadget')->retrieveMobileTopGadgets();
     180    $this->mobileContentsGadgets = (array)Doctrine::getTable('Gadget')->retrieveMobileContentsGadgets();
     181    $this->mobileBottomGadgets = (array)Doctrine::getTable('Gadget')->retrieveMobileBottomGadgets();
    182182    $this->gadgetConfig = sfConfig::get('op_mobile_gadget_list');
    183183
     
    192192  public function executeSideBannerGadgetPlot(sfWebRequest $request)
    193193  {
    194     $this->sideBannerContentsGadgets = (array)GadgetPeer::retrieveSideBannerContentsGadgets();
     194    $this->sideBannerContentsGadgets = (array)Doctrine::getTable('Gadget')->retrieveSideBannerContentsGadgets();
    195195    $this->gadgetConfig = sfConfig::get('op_side_banner_gadget_list');
    196196
     
    210210    $this->list = array();
    211211
    212     $types = NavigationPeer::retrieveTypes($isMobile);
     212    $types = Doctrine::getTable('Navigation')->retrieveTypes($isMobile);
    213213
    214214    foreach ($types as $type)
    215215    {
    216       $navs = NavigationPeer::retrieveByType($type);
     216      $navs = Doctrine::getTable('Navigation')->retrieveByType($type);
    217217      foreach ($navs as $nav)
    218218      {
     
    233233    $app = $request->getParameter('app', 'pc');
    234234
    235     $model = NavigationPeer::retrieveByPk($nav['id']);
     235    $model = Doctrine::getTable('Navigation')->find($nav['id']);
    236236    $this->form = new NavigationForm($model);
    237237    if ($request->isMethod('post'))
     
    258258    if ($request->isMethod('post'))
    259259    {
    260       $model = NavigationPeer::retrieveByPk($request->getParameter('id'));
     260      $model = Doctrine::getTable('Navigation')->find($request->getParameter('id'));
    261261      $this->forward404Unless($model);
    262262      $model->delete();
     
    287287        for ($i = 0; $i < count($order); $i++)
    288288        {
    289           $nav = NavigationPeer::retrieveByPk($order[$i]);
     289          $nav = Doctrine::getTable('Navigation')->find($order[$i]);
    290290          if ($nav)
    291291          {
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/design/lib/WidgetSortForm.class.php

    r10800 r11219  
    3434    foreach ($this->values as $type => $gadgets)
    3535    {
    36       $ids = GadgetPeer::getGadgetsIds($type);
     36      $ids = Doctrine::getTable('Gadget')->getGadgetsIds($type);
    3737      if (!$gadgets)
    3838      {
     
    4242      foreach ($ids as $id)
    4343      {
    44         $gadget = GadgetPeer::retrieveByPk($id);
     44        $gadget = Doctrine::getTable('Gadget')->find($id);
    4545        $key = array_search($id, $gadgets);
    4646
     
    6767    foreach ($value as $id)
    6868    {
    69       $gadget = GadgetPeer::retrieveByPk($id);
     69      $gadget = Doctrine::getTable('Gadget')->find($id);
    7070      if ($gadget)
    7171      {
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/member/actions/actions.class.php

    r10972 r11219  
    6666    }
    6767
    68     $this->member = MemberPeer::retrieveByPK($id);
     68    $this->member = Doctrine::getTable('Member')->find($id);
    6969    $this->forward404Unless($this->member);
    7070
     
    172172  {
    173173    $id = $request->getParameter('id');
    174     $this->member = MemberPeer::retrieveByPk($id);
     174    $this->member = Doctrine::getTable('Member')->find($id);
    175175    $this->forward404Unless($this->member);
    176176
  • OpenPNE3/branches/goto_doctrine/apps/pc_backend/modules/member/lib/AdminInviteForm.class.php

    r10480 r11219  
    7474    foreach ($this->getValue('pc') as $value)
    7575    {
    76       $this->member = MemberPeer::createPre();
     76      $this->member = Doctrine::getTable('Member')->createPre();
    7777      $this->saveConfig('pc_address', $value);
    7878      $this->member->setConfig('register_auth_mode', $authMode);
     
    8181    foreach ($this->getValue('mobile') as $value)
    8282    {
    83       $this->member = MemberPeer::createPre();
     83      $this->member = Doctrine::getTable('Member')->createPre();
    8484      $this->saveConfig('mobile_address', $value);
    8585      $this->member->setConfig('register_auth_mode', $authMode);
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/community/actions/components.class.php

    r11019 r11219  
    1414  {
    1515    $this->member = sfContext::getInstance()->getUser()->getMember();
    16     $c = new Criteria();
    17     $c->addAscendingOrderByColumn(Propel::getDB()->random(time()));
    1816    $this->row = $this->gadget->getConfig('row');
    1917    $this->col = $this->gadget->getConfig('col');
    20     $this->crownIds = CommunityMemberPeer::getCommunityIdsOfAdminByMemberId($this->member->getId());
    21     $this->communities = CommunityPeer::retrievesByMemberId($this->member->getId(), $this->row * $this->col, $c);
     18    $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($this->member->getId());
     19    $this->communities = Doctrine::getTable('Community')->retrievesByMemberId($this->member->getId(), $this->row * $this->col, true);
    2220  }
    2321}
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/community/templates/_joinListBox.php

    r10906 r11219  
    55  'crownIds' => $sf_data->getRaw('crownIds'),
    66  'link_to' => 'community/home?id=',
    7   'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->countCommunityMembers()), 'community/joinlist')),
     7  'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->CommunityMember->count()), 'community/joinlist')),
    88  'type' => $sf_data->getRaw('gadget')->getConfig('type'),
    99  'row' => $row,
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/default/actions/components.class.php

    r11209 r11219  
    1717      $type = 'secure_global';
    1818    }
    19     $this->navs = NavigationPeer::retrieveByType($type);
     19    $this->navs = Doctrine::getTable('Navigation')->retrieveByType($type);
    2020  }
    2121
     
    3232    $this->type = sfConfig::get('sf_nav_type', sfConfig::get('mod_' . $module . '_default_nav', 'default'));
    3333
    34     $this->navs = NavigationPeer::retrieveByType($this->type);
     34    $this->navs = Doctrine::getTable('Navigation')->retrieveByType($this->type);
    3535
    3636    if ('default' !== $this->type)
     
    4242  public function executeSideBannerGadgets()
    4343  {
    44     $this->gadgets = GadgetPeer::retrieveSideBannerContentsGadgets();
     44    $this->gadgets = Doctrine::getTable('Gadget')->retrieveSideBannerContentsGadgets();
    4545  }
    4646
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/default/templates/_globalNav.php

    r10270 r11219  
    22<ul>
    33<?php foreach ($navs as $nav): ?>
    4 <li><?php echo link_to($nav->getCaption(), $nav->getUri()) ?></li><?php endforeach; ?>
     4<li><?php echo link_to($nav->caption, $nav->uri) ?></li><?php endforeach; ?>
    55
    66</ul>
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/default/templates/_localNav.php

    r10390 r11219  
    33<?php foreach ($navs as $nav): ?>
    44<li><?php if (isset($navId)): ?>
    5 <?php echo link_to($nav->getCaption(), $nav->getUri().'?id='.$navId) ?>
     5<?php echo link_to($nav->caption, $nav->uri.'?id='.$navId) ?>
    66<?php else: ?>
    7 <?php echo link_to($nav->getCaption(), $nav->getUri()) ?>
     7<?php echo link_to($nav->caption, $nav->uri) ?>
    88<?php endif; ?></li><?php endforeach; ?>
    99
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/friend/actions/components.class.php

    r11019 r11219  
    1414  {
    1515    $this->member = sfContext::getInstance()->getUser()->getMember();
    16     $c = new Criteria();
    17     $c->addAscendingOrderByColumn(Propel::getDB()->random(time()));
    1816    $this->row = $this->gadget->getConfig('row');
    1917    $this->col = $this->gadget->getConfig('col');
    20     $this->friends = $this->member->getFriends($this->row * $this->col, $c);
     18    $this->friends = $this->member->getFriends($this->row * $this->col, true);
    2119  }
    2220}
  • OpenPNE3/branches/goto_doctrine/apps/pc_frontend/modules/member/actions/actions.class.php

    r11209 r11219  
    3434    if (!$layout || $layout->getValue() === 'layoutA')
    3535    {
    36       $this->topGadgets = GadgetPeer::retrieveTopGadgets();
     36      $this->topGadgets = Doctrine::getTable('Gadget')->retrieveTopGadgets();
    3737    }
    3838    if (!$layout || $layout->getValue() === 'layoutA' || $layout->getValue() === 'layoutB')
    3939    {
    40       $this->sideMenuGadgets = GadgetPeer::retrieveSideMenuGadgets();
     40      $this->sideMenuGadgets = Doctrine::getTable('Gadget')->retrieveSideMenuGadgets();
    4141    }
    42     $this->contentsGadgets = GadgetPeer::retrieveContentsGadgets();
    43     $this->bottomGadgets = GadgetPeer::retrieveBottomGadgets();
     42    $this->contentsGadgets = Doctrine::getTable('Gadget')->retrieveContentsGadgets();
     43    $this->bottomGadgets = Doctrine::getTable('Gadget')->retrieveBottomGadgets();
    4444
    4545    return parent::executeHome($request);
     
    6262    if (!$layout || $layout->getValue() === 'layoutA')
    6363    {
    64       $this->topGadgets = GadgetPeer::retrieveLoginTopGadgets();
     64      $this->topGadgets = Doctrine::getTable('Gadget')->retrieveLoginTopGadgets();
    6565    }
    6666    if (!$layout || $layout->getValue() === 'layoutA' || $layout->getValue() === 'layoutB')
    6767    {
    68       $this->sideMenuGadgets = GadgetPeer::retrieveLoginSideMenuGadgets();
     68      $this->sideMenuGadgets = Doctrine::getTable('Gadget')->retrieveLoginSideMenuGadgets();
    6969    }
    70     $this->contentsGadgets = GadgetPeer::retrieveLoginContentsGadgets();
    71     $this->bottomGadgets = GadgetPeer::retrieveLoginBottomGadgets();
     70    $this->contentsGadgets = Doctrine::getTable('Gadget')->retrieveLoginContentsGadgets();
     71    $this->bottomGadgets = Doctrine::getTable('Gadget')->retrieveLoginBottomGadgets();
    7272
    7373    return parent::executeLogin($request);
     
    9090    $this->filters->bind($params);
    9191
    92     $this->pager = new sfPropelPager('Member', 20);
    93     $c = $this->filters->getCriteria();
    94     $c->addDescendingOrderByColumn(MemberPeer::ID);
    95     $this->pager->setCriteria($c);
     92    $this->pager = new sfDoctrinePager('Member', 20);
     93    $q = $this->pager->getQuery()->orderBy('id');
     94    $this->pager->setQuery($q);
    9695    $this->pager->setPage($request->getParameter('page', 1));
    9796    $this->pager->init();
  • OpenPNE3/branches/goto_doctrine/config/doctrine/schema.yml

    r11208 r11219  
    2424      foreign: id
    2525      type: one
     26  options:
     27    charset: utf8
    2628AdminUser:
    2729  tableName: admin_user
     
    3941      default: ""
    4042      notnull: true
     43  options:
     44    charset: utf8
    4145Community:
    4246  tableName: community
     
    6266      foreign: id
    6367      type: one
     68  options:
     69    charset: utf8
    6470MemberRelationship:
    6571  tableName: member_relationship
     
    8894      foreign: id
    8995      type: one
     96  options:
     97    charset: utf8
    9098CommunityConfig:
    9199  tableName: community_config
     
    108116      foreign: id
    109117      type: one
     118  options:
     119    charset: utf8
    110120MemberConfig:
    111121  tableName: member_config
     
    128138      foreign: id
    129139      type: one
     140  options:
     141    charset: utf8
    130142Profile:
    131143  tableName: profile
     
    133145    I18n:
    134146      fields: [caption, info]
     147      length: 5
    135148  columns:
    136149    id:
     
    186199      notnull: true
    187200    info: string(2147483647)
     201  options:
     202    charset: utf8
    188203SnsConfig:
    189204  tableName: sns_config
     
    198213      notnull: true
    199214    value: string(2147483647)
     215  options:
     216    charset: utf8
    200217MemberImage:
    201218  tableName: member_image
     
    221238      foreign: id
    222239      type: one
     240  options:
     241    charset: utf8
    223242Blacklist:
    224243  tableName: blacklist
     
    233252      notnull: true
    234253    memo: string(2147483647)
     254  options:
     255    charset: utf8
    235256MemberProfile:
    236257  tableName: member_profile
     
    266287      foreign: id
    267288      type: one
     289  options:
     290    charset: utf8
    268291FileBin:
    269292  tableName: file_bin
     
    278301      foreign: id
    279302      type: one
     303  options:
     304    charset: utf8
    280305CommunityCategory:
    281306  tableName: community_category
     
    301326    tree_key: integer(4)
    302327    sort_order: integer(4)
     328  options:
     329    charset: utf8
    303330GadgetConfig:
    304331  tableName: gadget_config
     
    319346      foreign: id
    320347      type: one
     348  options:
     349    charset: utf8
    321350ProfileOption:
    322351  tableName: profile_option
     
    324353    I18n:
    325354      fields: [value]
     355      length: 5
    326356  columns:
    327357    id:
     
    339369      foreign: id
    340370      type: one
     371  options:
     372    charset: utf8
    341373Gadget:
    342374  tableName: gadget
     
    355387      notnull: true
    356388    sort_order: integer(4)
     389  options:
     390    charset: utf8
    357391File:
    358392  tableName: file
     
    372406      notnull: true
    373407    original_filename: string(2147483647)
     408  options:
     409    charset: utf8
    374410Navigation:
    375411  tableName: navigation
     
    377413    I18n:
    378414      fields: [caption]
     415      length: 5
    379416  columns:
    380417    id:
     
    393430      notnull: true
    394431    sort_order: integer(4)
     432  options:
     433    charset: utf8
    395434Member:
    396435  tableName: member
     
    415454      foreign: id
    416455      type: one
     456  options:
     457    charset: utf8
  • OpenPNE3/branches/goto_doctrine/lib/action/sfOpenPNECommunityAction.class.php

    r11045 r11219  
    2323
    2424    $memberId = $this->getUser()->getMemberId();
    25     $this->isCommunityMember = CommunityMemberPeer::isMember($memberId, $this->id);
    26     $this->isCommunityPreMember = CommunityMemberPeer::isPreMember($memberId, $this->id);
    27     $this->isAdmin = CommunityMemberPeer::isAdmin($memberId, $this->id);
     25    $this->isCommunityMember = Doctrine::getTable('CommunityMember')->isMember($memberId, $this->id);
     26    $this->isCommunityPreMember = Doctrine::getTable('CommunityMember')->isPreMember($memberId, $this->id);
     27    $this->isAdmin = Doctrine::getTable('CommunityMember')->isAdmin($memberId, $this->id);
    2828    $this->isEditCommunity = $this->isAdmin;
    2929  }
     
    3838    $this->community = CommunityPeer::retrieveByPk($this->id);
    3939    $this->forward404Unless($this->community, 'Undefined community.');
    40     $this->community_admin = CommunityMemberPeer::getCommunityAdmin($this->id);
    41     $this->community_admin = MemberPeer::retrieveByPk($this->community_admin->getMemberId());
     40    $this->community_admin = Doctrine::getTable('CommunityMember')->getCommunityAdmin($this->id);
     41    $this->community_admin = Doctrine::getTable('Member')->find($this->community_admin->getMemberId());
    4242
    4343    if (!$this->membersSize)
     
    9999    $memberId = $request->getParameter('id', $this->getUser()->getMemberId());
    100100
    101     $this->member = MemberPeer::retrieveByPK($memberId);
     101    $this->member = Doctrine::getTable('Member')->find($memberId);
    102102    $this->forward404Unless($this->member);
    103103
     
    114114    }
    115115
    116     $this->crownIds = CommunityMemberPeer::getCommunityIdsOfAdminByMemberId($memberId);
     116    $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($memberId);
    117117
    118118    return sfView::SUCCESS;
     
    139139    }
    140140   
    141     $this->crownIds = array(CommunityMemberPeer::getCommunityAdmin($this->id)->getMemberId());
     141    $this->crownIds = array(Doctrine::getTable('CommunityMember')->getCommunityAdmin($this->id)->getMemberId());
    142142   
    143143    return sfView::SUCCESS;
     
    158158    $this->forward404Unless($community);
    159159
    160     CommunityMemberPeer::join($this->getUser()->getMemberId(), $this->id, $community->getConfig('register_poricy'));
     160    Doctrine::getTable('CommunityMember')->join($this->getUser()->getMemberId(), $this->id, $community->getConfig('register_poricy'));
    161161    $this->redirect('community/home?id=' . $this->id);
    162162  }
     
    171171    $this->forward404Unless($this->isAdmin);
    172172   
    173     $communityMember = CommunityMemberPeer::retrieveByMemberIdAndCommunityId($request->getParameter('member_id'), $this->id);
     173    $communityMember = Doctrine::getTable('CommunityMember')->retrieveByMemberIdAndCommunityId($request->getParameter('member_id'), $this->id);
    174174    $this->forward404Unless($communityMember);
    175175
     
    191191    $this->forward404Unless($this->isAdmin);
    192192   
    193     $communityMember = CommunityMemberPeer::retrieveByMemberIdAndCommunityId($request->getParameter('member_id'), $this->id);
     193    $communityMember = Doctrine::getTable('CommunityMember')->retrieveByMemberIdAndCommunityId($request->getParameter('member_id'), $this->id);
    194194    $this->forward404Unless($communityMember);
    195195
     
    213213    }
    214214
    215     CommunityMemberPeer::quit($this->getUser()->getMemberId(), $this->id);
     215    Doctrine::getTable('CommunityMember')->quit($this->getUser()->getMemberId(), $this->id);
    216216    $this->redirect('community/home?id=' . $this->id);
    217217  }
     
    245245  {
    246246    $this->redirectUnless($this->isAdmin, '@error');
    247     $member = MemberPeer::retrieveByPk($request->getParameter('member_id'));
     247    $member = Doctrine::getTable('Member')->find($request->getParameter('member_id'));
    248248    $this->forward404Unless($member);
    249249
    250     $isCommunityMember = CommunityMemberPeer::isMember($member->getId(), $this->id);
     250    $isCommunityMember = Doctrine::getTable('CommunityMember')->isMember($member->getId(), $this->id);
    251251    $this->redirectUnless($this->isAdmin, '@error');
    252     $isAdmin = CommunityMemberPeer::isAdmin($member->getId(), $this->id);
     252    $isAdmin = Doctrine::getTable('CommunityMember')->isAdmin($member->getId(), $this->id);
    253253    $this->redirectIf($isAdmin, '@error');
    254254
    255     CommunityMemberPeer::quit($member->getId(), $this->id);
     255    Doctrine::getTable('CommunityMember')->quit($member->getId(), $this->id);
    256256    $this->redirect('community/memberManage?id='.$this->id);
    257257  }
  • OpenPNE3/branches/goto_doctrine/lib/action/sfOpenPNECommunityComponents.class.php

    r11019 r11219  
    2222    $memberId = sfContext::getInstance()->getUser()->getMemberId();
    2323   
    24     $this->communityMembers = CommunityMemberPeer::getCommunityMembersPre($memberId);
     24    $this->communityMembers = Doctrine::getTable('CommunityMember')->getCommunityMembersPre($memberId);
    2525  }
    2626}
  • OpenPNE3/branches/goto_doctrine/lib/action/sfOpenPNEFriendAction.class.php

    r10899 r11219  
    2323    $this->id = $this->getRequestParameter('id', $this->getUser()->getMemberId());
    2424
    25     $this->relation = MemberRelationshipPeer::retrieveByFromAndTo($this->getUser()->getMemberId(), $this->id);
     25    $this->relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($this->getUser()->getMemberId(), $this->id);
    2626    if (!$this->relation) {
    2727      $this->relation = new MemberRelationship();
     
    4444      $this->size = 20;
    4545    }
    46     $this->pager = MemberRelationshipPeer::getFriendListPager($this->id, $request->getParameter('page', 1), $this->size);
     46    $this->pager = Doctrine::getTable('MemberRelationship')->getFriendListPager($this->id, $request->getParameter('page', 1), $this->size);
    4747
    4848    if (!$this->pager->getNbResults()) {
     
    149149  public function executeManage($request)
    150150  {
    151     $this->pager = MemberRelationshipPeer::getFriendListPager($this->getUser()->getMemberId(), $request->getParameter('page', 1));
     151    $this->pager = Doctrine::getTable('MemberRelationship')->getFriendListPager($this->getUser()->getMemberId(), $request->getParameter('page', 1));
    152152
    153153    if (!$this->pager->getNbResults()) {
     
    167167    $this->forward404Unless($this->id);
    168168
    169     $this->member = MemberPeer::retrieveByPk($this->id);
     169    $this->member = Doctrine::getTable('Member')->find($this->id);
    170170    $this->forward404Unless($this->member, 'Undefined member.');
    171171
  • OpenPNE3/branches/goto_doctrine/lib/action/sfOpenPNEMemberAction.class.php

    r11151 r11219  
    2222    $this->id = $this->getRequestParameter('id', $this->getUser()->getMemberId());
    2323
    24     $this->relation = MemberRelationshipPeer::retrieveByFromAndTo($this->getUser()->getMemberId(), $this->id);
     24    $this->relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($this->getUser()->getMemberId(), $this->id);
    2525    if (!$this->relation) {
    2626      $this->relation = new MemberRelationship();
     
    112112
    113113    $id = $this->getRequestParameter('id', $this->getUser()->getMemberId());
    114     $this->member = MemberPeer::retrieveByPk($id);
     114    $this->member = Doctrine::getTable('Member')->find($id);
    115115   
    116116    $this->forward404Unless($this->member, 'Undefined member.');
     
    130130    }
    131131    $this->communities = $this->member->getJoinCommunities($this->communitiesSize, $c);
    132     $this->crownIds = CommunityMemberPeer::getCommunityIdsOfAdminByMemberId($id);
     132    $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($id);
    133133
    134134    return sfView::SUCCESS;
     
    175175    $memberId = $request->getParameter('id');
    176176
    177     $memberConfig = MemberConfigPeer::retrieveByNameAndMemberId($type.'_token', $memberId);
     177    $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId($type.'_token', $memberId);
    178178    $this->forward404Unless($memberConfig);
    179179    $this->forward404Unless((bool)$request->getParameter('token') !== $memberConfig->getValue());
     
    187187      if ($this->form->isValid())
    188188      {
    189         $config = MemberConfigPeer::retrieveByNameAndMemberId($type, $memberId);
    190         $pre = MemberConfigPeer::retrieveByNameAndMemberId($type.'_pre', $memberId);
     189        $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId($type, $memberId);
     190        $pre = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId($type.'_pre', $memberId);
    191191
    192192        if (!$config)
     
    201201        {
    202202          $pre->delete();
    203           $token = MemberConfigPeer::retrieveByNameAndMemberId($type.'_token', $memberId);
     203          $token = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId($type.'_token', $memberId);
    204204          $token->delete();
    205205        }
  • OpenPNE3/branches/goto_doctrine/lib/filter/sfOpenPNEExecutionFilter.class.php

    r10582 r11219  
    2323    $actionName = $actionInstance->getActionName();
    2424    $dispatcher = sfContext::getInstance()->getEventDispatcher();
     25
     26    // sfDoctrinePlugin needs to notify this event for enabling i18n
     27    $dispatcher->notify(new sfEvent(
     28      $this, 'user.change_culture', array('culture' => sfContext::getInstance()->getUser()->getCulture())
     29    ));
    2530
    2631    $dispatcher->notify(new sfEvent($this, 'op_action.pre_execute_'.$moduleName.'_'.$actionName, array(
  • OpenPNE3/branches/goto_doctrine/lib/form/MemberConfigForm/MemberConfigAccessBlock.class.php

    r10003 r11219  
    2424  public function configure()
    2525  {
    26     $relations = MemberRelationshipPeer::retrievesByMemberIdFrom($this->member->getId());
     26    $relations = Doctrine::getTable('MemberRelationship')->retrievesByMemberIdFrom($this->member->getId());
    2727    foreach ($relations as $relation)
    2828    {
     
    4343    foreach ($value as $memberId)
    4444    {
    45       $relation = MemberRelationshipPeer::retrieveByFromAndTo($this->member->getId(), $memberId);
     45      $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($this->member->getId(), $memberId);
    4646      if (!$relation)
    4747      {
     
    9191      }
    9292
    93       if (!MemberPeer::retrieveByPK($memberId))
     93      if (!Doctrine::getTable('Member')->find($memberId))
    9494      {
    9595        throw new sfValidatorError($validator, 'invalid');
  • OpenPNE3/branches/goto_doctrine/lib/form/MemberConfigForm/MemberConfigMobileAddressForm.class.php

    r10613 r11219  
    2626      $this->savePreConfig($name, $value);
    2727
    28       $memberConfig = MemberConfigPeer::retrieveByNameAndMemberId('mobile_address_token', $this->member->getId(), true);
     28      $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('mobile_address_token', $this->member->getId(), true);
    2929      $token = $memberConfig->getValue();
    3030      $this->sendConfirmMail($token, $value, array(
  • OpenPNE3/branches/goto_doctrine/lib/form/MemberConfigForm/MemberConfigPasswordForm.class.php

    r11020 r11219  
    3030  {
    3131    $member = sfContext::getInstance()->getUser()->getMember();
    32     if (md5($value) !== MemberConfigPeer::retrieveByNameAndMemberId('password', $member->getId())->getValue())
     32    if (md5($value) !== Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('password', $member->getId())->getValue())
    3333    {
    3434      throw new sfValidatorError(new sfValidatorPass(), 'invalid', array('value' => $value));
  • OpenPNE3/branches/goto_doctrine/lib/form/MemberConfigForm/MemberConfigPcAddressForm.class.php

    r10020 r11219  
    2626      $this->savePreConfig($name, $value);
    2727
    28       $memberConfig = MemberConfigPeer::retrieveByNameAndMemberId('pc_address_token', $this->member->getId());
     28      $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('pc_address_token', $this->member->getId());
    2929      $token = $memberConfig->getValue();
    3030      $this->sendConfirmMail($token, $value, array(
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseCommunityConfigForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'           => new sfWidgetFormInputHidden(),
    16       'community_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Community', 'add_empty' => false)),
     16      'community_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Community', 'add_empty' => false)),
    1717      'name'         => new sfWidgetFormInput(),
    1818      'value'        => new sfWidgetFormTextarea(),
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseCommunityForm.class.php

    r11208 r11219  
    1515      'id'                    => new sfWidgetFormInputHidden(),
    1616      'name'                  => new sfWidgetFormInput(),
    17       'file_id'               => new sfWidgetFormDoctrineSelect(array('model' => 'File', 'add_empty' => true)),
    18       'community_category_id' => new sfWidgetFormDoctrineSelect(array('model' => 'CommunityCategory', 'add_empty' => true)),
     17      'file_id'               => new sfWidgetFormDoctrineChoice(array('model' => 'File', 'add_empty' => true)),
     18      'community_category_id' => new sfWidgetFormDoctrineChoice(array('model' => 'CommunityCategory', 'add_empty' => true)),
    1919      'created_at'            => new sfWidgetFormDateTime(),
    2020      'updated_at'            => new sfWidgetFormDateTime(),
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseCommunityMemberForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'           => new sfWidgetFormInputHidden(),
    16       'community_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Community', 'add_empty' => false)),
    17       'member_id'    => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => false)),
     16      'community_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Community', 'add_empty' => false)),
     17      'member_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => false)),
    1818      'position'     => new sfWidgetFormInput(),
    1919    ));
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseGadgetConfigForm.class.php

    r11208 r11219  
    1515      'id'        => new sfWidgetFormInputHidden(),
    1616      'name'      => new sfWidgetFormInput(),
    17       'gadget_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Gadget', 'add_empty' => true)),
     17      'gadget_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Gadget', 'add_empty' => true)),
    1818      'value'     => new sfWidgetFormTextarea(),
    1919    ));
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseMemberConfigForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'        => new sfWidgetFormInputHidden(),
    16       'member_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => false)),
     16      'member_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => false)),
    1717      'name'      => new sfWidgetFormInput(),
    1818      'value'     => new sfWidgetFormTextarea(),
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseMemberForm.class.php

    r11208 r11219  
    1616      'name'             => new sfWidgetFormInput(),
    1717      'is_active'        => new sfWidgetFormInput(),
    18       'invite_member_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => true)),
     18      'invite_member_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => true)),
    1919      'created_at'       => new sfWidgetFormDateTime(),
    2020      'updated_at'       => new sfWidgetFormDateTime(),
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseMemberImageForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'         => new sfWidgetFormInputHidden(),
    16       'member_id'  => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => false)),
    17       'file_id'    => new sfWidgetFormDoctrineSelect(array('model' => 'File', 'add_empty' => false)),
     16      'member_id'  => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => false)),
     17      'file_id'    => new sfWidgetFormDoctrineChoice(array('model' => 'File', 'add_empty' => false)),
    1818      'is_primary' => new sfWidgetFormInput(),
    1919    ));
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseMemberProfileForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'                => new sfWidgetFormInputHidden(),
    16       'member_id'         => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => false)),
    17       'profile_id'        => new sfWidgetFormDoctrineSelect(array('model' => 'Profile', 'add_empty' => false)),
    18       'profile_option_id' => new sfWidgetFormDoctrineSelect(array('model' => 'ProfileOption', 'add_empty' => true)),
     16      'member_id'         => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => false)),
     17      'profile_id'        => new sfWidgetFormDoctrineChoice(array('model' => 'Profile', 'add_empty' => false)),
     18      'profile_option_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ProfileOption', 'add_empty' => true)),
    1919      'value'             => new sfWidgetFormTextarea(),
    2020      'public_flag'       => new sfWidgetFormInput(),
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseMemberRelationshipForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'              => new sfWidgetFormInputHidden(),
    16       'member_id_to'    => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => false)),
    17       'member_id_from'  => new sfWidgetFormDoctrineSelect(array('model' => 'Member', 'add_empty' => false)),
     16      'member_id_to'    => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => false)),
     17      'member_id_from'  => new sfWidgetFormDoctrineChoice(array('model' => 'Member', 'add_empty' => false)),
    1818      'is_friend'       => new sfWidgetFormInput(),
    1919      'is_friend_pre'   => new sfWidgetFormInput(),
  • OpenPNE3/branches/goto_doctrine/lib/form/doctrine/base/BaseProfileOptionForm.class.php

    r11208 r11219  
    1414    $this->setWidgets(array(
    1515      'id'         => new sfWidgetFormInputHidden(),
    16       'profile_id' => new sfWidgetFormDoctrineSelect(array('model' => 'Profile', 'add_empty' => false)),
     16      'profile_id' => new sfWidgetFormDoctrineChoice(array('model' => 'Profile', 'add_empty' => false)),
    1717      'sort_order' => new sfWidgetFormInput(),
    1818    ));
  • OpenPNE3/branches/goto_doctrine/lib/form/opAuthRegisterForm.class.php

    r10122 r11219  
    4343    else
    4444    {
    45       $this->setMember(MemberPeer::createPre());
     45      $this->setMember(Doctrine::getTable('Member')->createPre());
    4646    }
    4747
  • OpenPNE3/branches/goto_doctrine/lib/form/sfOpenPNEPasswordForm.class.php

    r10772 r11219  
    3737  {
    3838    $member = $this->options['member'];
    39     if (md5($value) !== MemberConfigPeer::retrieveByNameAndMemberId('password', $member->getId())->getValue())
     39    if (md5($value) !== Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('password', $member->getId())->getValue())
    4040    {
    4141      throw new sfValidatorError(new sfValidatorPass(), 'invalid', array('value' => $value));
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/CommunityMemberTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class CommunityMemberTable extends Doctrine_Table
    612{
     13  public function retrieveByMemberIdAndCommunityId($memberId, $communityId)
     14  {
     15    return $this->createQuery()
     16        ->where('member_id = ?', $memberId)
     17        ->andWhere('community_id = ?', $communityId)
     18        ->fetchOne();
     19  }
    720
     21  public function isMember($memberId, $communityId)
     22  {
     23    $communityMember = $this->retrieveByMemberIdAndCommunityId($memberId, $communityId);
     24    if (!$communityMember)
     25    {
     26      return false;
     27    }
     28    return ($communityMember->position != 'pre');
     29  }
     30
     31  public function isPreMember($memberId, $communityId)
     32  {
     33    $communityMember = $this->retrieveByMemberIdAndCommunityId($memberId, $communityId);
     34    if (!$communityMember)
     35    {
     36      return false;
     37    }
     38    return ($communityMember->position == 'pre');
     39  }
     40
     41  public function isAdmin($memberId, $communityId)
     42  {
     43    $communityMember = $this->retrieveByMemberIdAndCommunityId($memberId, $communityId);
     44    if (!$communityMember) {
     45      return false;
     46    }
     47
     48    if ($communityMember->position != 'admin') {
     49      return false;
     50    }
     51
     52    return true;
     53  }
     54
     55  public function join($memberId, $communityId, $isRegisterPoricy = 'open')
     56  {
     57    if ($this->isPreMember($memberId, $communityId))
     58    {
     59      throw new Exception('This member has already applied this community.');
     60    }
     61
     62    if ($this->isMember($memberId, $communityId))
     63    {
     64      throw new Exception('This member has already joined this community.');
     65    }
     66
     67    $communityMember = new CommunityMember();
     68    $communityMember->memberId = $memberId;
     69    $communityMember->communityId = $communityId;
     70    if ($isRegisterPoricy == 'close')
     71    {
     72      $communityMember->position = 'pre';
     73    }
     74    $communityMember->save();
     75  }
     76
     77  public function quit($memberId, $communityId)
     78  {
     79    if (!$this->isMember($memberId, $communityId)) {
     80      throw new Exception('This member is not a member of this community.');
     81    }
     82
     83    if ($this->isAdmin($memberId, $communityId)) {
     84      throw new Exception('This member is community admin.');
     85    }
     86
     87    $communityMember = $this->retrieveByMemberIdAndCommunityId($memberId, $communityId);
     88    $communityMember->delete();
     89  }
     90
     91  public function getCommunityAdmin($communityId)
     92  {
     93    return $this->createQuery()
     94        ->where('community_id = ?', $communityId)
     95        ->andWhere('position = ?', 'admin')
     96        ->fetchOne();
     97  }
     98
     99  public function getCommunityIdsOfAdminByMemberId($memberId)
     100  {
     101    return $this->createQuery()
     102        ->select('community_id')
     103        ->where('member_id = ?', $memberId)
     104        ->andWhere('position = ?', 'admin')
     105        ->fetchArray();
     106  }
     107
     108  public function getCommunityMembersPre($memberId)
     109  {
     110    $adminCommunityIds = $this->getCommunityIdsOfAdminByMemberId($memberId);
     111
     112    if (count($adminCommunityIds))
     113    {
     114      return $this->createQuery()
     115        ->whereIn('community_id', $adminCommunityIds)
     116        ->where('position', 'pre')
     117        ->execute();
     118    }
     119
     120    return array();
     121  }
    8122}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/CommunityTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class CommunityTable extends Doctrine_Table
    612{
     13  public function retrievesByMemberId($memberId, $limit = 5, $isRandom = false)
     14  {
     15    $q = Doctrine::getTable('Community')->createQuery()
     16        ->where('CommunityMember.member_id = ?', $memberId)
     17        ->andWhere('CommunityMember.position <> ?', 'pre')
     18        ->leftJoin('CommunityMember');
    719
     20    if (!is_null($limit))
     21    {
     22      $q->limit($limit);
     23    }
     24
     25    if ($isRandom)
     26    {
     27      $expr = new Doctrine_Expression('RANDOM()');
     28      $q->orderBy($expr);
     29    }
     30
     31    return $q->execute();
     32  }
     33
     34  public function getJoinCommunityListPager($memberId, $page = 1, $size = 20)
     35  {
     36    $c = new Criteria();
     37    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
     38    $c->add(CommunityMemberPeer::POSITION, 'pre', Criteria::NOT_EQUAL);
     39    $c->addJoin(self::ID, CommunityMemberPeer::COMMUNITY_ID);
     40
     41    $pager = new sfPropelPager('Community', $size);
     42    $pager->setCriteria($c);
     43    $pager->setPage($page);
     44    $pager->init();
     45
     46    return $pager;
     47  }
     48
     49  public function getCommunityMemberListPager($communityId, $page = 1, $size = 20)
     50  {
     51    $c = new Criteria();
     52    $c->add(CommunityMemberPeer::COMMUNITY_ID, $communityId);
     53    $c->add(CommunityMemberPeer::POSITION, 'pre', Criteria::NOT_EQUAL);
     54    $c->addJoin(MemberPeer::ID, CommunityMemberPeer::MEMBER_ID);
     55
     56    $pager = new sfPropelPager('Member', $size);
     57    $pager->setCriteria($c);
     58    $pager->setPage($page);
     59    $pager->init();
     60
     61    return $pager;
     62  }
     63
     64  public function getIdsByMemberId($memberId)
     65  {
     66    $result = array();
     67
     68    $c = new Criteria();
     69    $c->clearSelectColumns()->addSelectColumn(self::ID);
     70    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
     71    $c->add(CommunityMemberPeer::POSITION, 'pre', Criteria::NOT_EQUAL);
     72    $c->addJoin(self::ID, CommunityMemberPeer::COMMUNITY_ID);
     73    $stmt = self::doSelectStmt($c);
     74
     75    while ($row = $stmt->fetch(PDO::FETCH_NUM))
     76    {
     77      $result[] = $row[0];
     78    }
     79
     80    return $result;
     81  }
    882}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/Gadget.class.php

    r11208 r11219  
    22
    33/**
    4  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    59 */
     10
    611class Gadget extends BaseGadget
    712{
     13  public function getComponentModule()
     14  {
     15    $list = Doctrine::getTable('Gadget')->getGadgetConfigListByType($this->type);
     16    if (empty($list[$this->name]))
     17    {
     18      return false;
     19    }
    820
     21    return $list[$this->name]['component'][0];
     22  }
     23
     24  public function getComponentAction()
     25  {
     26    $list = Doctrine::getTable('Gadget')->getGadgetConfigListByType($this->type);
     27    if (empty($list[$this->name]))
     28    {
     29      return false;
     30    }
     31
     32    return $list[$this->name]['component'][1];
     33  }
     34
     35  public function isEnabled()
     36  {
     37    $list = Doctrine::getTable('Gadget')->getGadgetConfigListByType($this->type);
     38    if (empty($list[$this->name]))
     39    {
     40      return false;
     41    }
     42
     43    return true;
     44  }
     45
     46  public function getConfig($name)
     47  {
     48    return null;
     49
     50    $result = null;
     51    $list = GadgetPeer::getGadgetConfigListByType($this->getType());
     52
     53    $config = GadgetConfigPeer::retrieveByGadgetIdAndName($this->getId(), $name);
     54    if ($config)
     55    {
     56      $result = $config->getValue();
     57    }
     58    elseif (isset($list[$this->getName()]['config'][$name]['Default']))
     59    {
     60      $result = $list[$this->getName()]['config'][$name]['Default'];
     61    }
     62
     63    return $result;
     64  }
    965}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/GadgetTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class GadgetTable extends Doctrine_Table
    612{
     13  const HOME_TYPES = 'home';
     14  const LOGIN_TYPES = 'login';
     15  const MOBILE_HOME_TYPES = 'mobileHome';
     16  const SIDE_BANNER_TYPES = 'sideBanner';
     17
     18  const TOP_TYPE = 'top';
     19  const SIDE_MENU_TYPE = 'sideMenu';
     20  const CONTENTS_TYPE = 'contents';
     21  const BOTTOM_TYPE = 'bottom';
     22
     23  const LOGIN_TOP_TYPE = 'loginTop';
     24  const LOGIN_SIDE_MENU_TYPE = 'loginSideMenu';
     25  const LOGIN_CONTENTS_TYPE = 'loginContents';
     26  const LOGIN_BOTTOM_TYPE = 'loginBottom';
     27
     28  const MOBILE_TOP_TYPE = 'mobileTop';
     29  const MOBILE_CONTENTS_TYPE = 'mobileContents';
     30  const MOBILE_BOTTOM_TYPE = 'mobileBottom';
     31
     32  const SIDE_BANNER_CONTENTS_TYPE = 'sideBannerContents';
     33
     34  protected
     35    $homeTypes = array(self::TOP_TYPE, self::SIDE_MENU_TYPE, self::CONTENTS_TYPE, self::BOTTOM_TYPE),
     36    $loginTypes = array(self::LOGIN_TOP_TYPE, self::LOGIN_SIDE_MENU_TYPE, self::LOGIN_CONTENTS_TYPE, self::LOGIN_BOTTOM_TYPE),
     37    $mobileHomeTypes = array(self::MOBILE_TOP_TYPE, self::MOBILE_CONTENTS_TYPE, self::MOBILE_BOTTOM_TYPE),
     38    $sideBannerTypes = array(self::SIDE_BANNER_CONTENTS_TYPE),
     39    $results;
     40
     41  public function retrieveGadgetsByTypesName($typesName)
     42  {
     43    $results = array();
     44    switch ($typesName)
     45    {
     46      case self::MOBILE_HOME_TYPES:
     47        $types = $this->mobileHomeTypes;
     48        break;
     49      case self::LOGIN_TYPES:
     50        $types = $this->loginTypes;
     51        break;
     52      case self::SIDE_BANNER_TYPES:
     53        $types = $this->sideBannerTypes;
     54        break;
     55      default:
     56        $types = $this->homeTypes;
     57    }
     58   
     59    foreach($types as $type)
     60    {
     61      $results[$type] = $this->retrieveByType($type);
     62    }
     63
     64    return $results;
     65  }
     66
     67  public function retrieveTopGadgets()
     68  {
     69    return $this->retrieveByType(self::TOP_TYPE);
     70  }
     71
     72  public function retrieveSideMenuGadgets()
     73  {
     74    return $this->retrieveByType(self::SIDE_MENU_TYPE);
     75  }
     76
     77  public function retrieveContentsGadgets()
     78  {
     79    return $this->retrieveByType(self::CONTENTS_TYPE);
     80  }
     81
     82  public function retrieveBottomGadgets()
     83  {
     84    return $this->retrieveByType(self::BOTTOM_TYPE);
     85  }
     86
     87  public function retrieveLoginTopGadgets()
     88  {
     89    return $this->retrieveByType(self::LOGIN_TOP_TYPE);
     90  }
     91
     92  public function retrieveLoginSideMenuGadgets()
     93  {
     94    return $this->retrieveByType(self::LOGIN_SIDE_MENU_TYPE);
     95  }
     96
     97  public function retrieveLoginContentsGadgets()
     98  {
     99    return $this->retrieveByType(self::LOGIN_CONTENTS_TYPE);
     100  }
     101
     102  public function retrieveLoginBottomGadgets()
     103  {
     104    return $this->retrieveByType(self::LOGIN_BOTTOM_TYPE);
     105  }
     106
     107  public function retrieveMobileTopGadgets()
     108  {
     109    return $this->retrieveByType(self::MOBILE_TOP_TYPE);
     110  }
     111
     112  public function retrieveMobileContentsGadgets()
     113  {
     114    return $this->retrieveByType(self::MOBILE_CONTENTS_TYPE);
     115  }
     116
     117  public function retrieveMobileBottomGadgets()
     118  {
     119    return $this->retrieveByType(self::MOBILE_BOTTOM_TYPE);
     120  }
     121
     122  public function retrieveSideBannerContentsGadgets()
     123  {
     124    return $this->retrieveByType(self::SIDE_BANNER_CONTENTS_TYPE);
     125  }
     126
     127  public function getTopGadgetsIds()
     128  {
     129    return $this->getGadgetsIds(self::TOP_TYPE);
     130  }
     131
     132  public function getSideMenuGadgetsIds()
     133  {
     134    return $this->getGadgetsIds(self::SIDE_MENU_TYPE);
     135  }
     136
     137  public function getContentsGadgetsIds()
     138  {
     139    return $this->getGadgetsIds(self::CONTENTS_TYPE);
     140  }
     141
     142  public function retrieveByType($type)
     143  {
     144    $results = $this->getResults();
     145
     146    return (isset($results[$type])) ? $results[$type] : null;
     147  }
     148
     149  public function getGadgetsIds($type)
     150  {
     151    return $this->createQuery()
     152      ->select('id')
     153      ->where('type', $type)
     154      ->orderBy('sort_order')
     155      ->fetchArray();
     156  }
     157
     158  protected function getResults()
     159  {
     160    if (is_null($this->results))
     161    {
     162      $this->results = array();
     163      $objects = $this->createQuery()->orderBy('sort_order')->execute();
     164      foreach ($objects as $object)
     165      {
     166        $this->results[$object->type][] = $object;
     167      }
     168    }
     169
     170    return $this->results;
     171  }
     172 
     173  public function getGadgetConfigListByType($type)
     174  {
     175    if (in_array($type, $this->homeTypes))
     176    {
     177      return sfConfig::get('op_gadget_list', array());
     178    }
     179    elseif (in_array($type, $this->loginTypes))
     180    {
     181      return sfConfig::get('op_login_gadget_list', array());
     182    }
     183    elseif (in_array($type, $this->mobileHomeTypes))
     184    {
     185      return sfConfig::get('op_mobile_gadget_list', array());
     186    }
     187    elseif (in_array($type, $this->sideBannerTypes))
     188    {
     189      return sfConfig::get('op_side_banner_gadget_list', array());
     190    }
     191    return array();
     192  }
    7193
    8194}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/Member.class.php

    r11208 r11219  
    22
    33/**
    4  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    59 */
     10
    611class Member extends BaseMember
    712{
    8 
     13  public function getProfiles($viewableCheck = false, $myMemberId = null)
     14  {
     15  /*
     16    if ($viewableCheck)
     17    {
     18      return MemberProfilePeer::getViewableProfileListByMemberId($this->getId(), $myMemberId);
     19    }
     20    return MemberProfilePeer::getProfileListByMemberId($this->getId());
     21    */
     22
     23    return array();
     24  }
     25
     26  public function getProfile($profileName)
     27  {
     28  /*
     29    $profile = MemberProfilePeer::retrieveByMemberIdAndProfileName($this->getId(), $profileName);
     30    return $profile;
     31    */
     32
     33    return array();
     34  }
     35
     36  public function getConfig($configName)
     37  {
     38    $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId($configName, $this->getId());
     39
     40    if (!$config)
     41    {
     42      return null;
     43    }
     44
     45    return $config->getValue();
     46  }
     47
     48  public function setConfig($configName, $value)
     49  {
     50    $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId($configName, $this->getId());
     51    if (!$config)
     52    {
     53      $config = new MemberConfig();
     54      $config->setMember($this);
     55      $config->setName($configName);
     56    }
     57    $config->setValue($value);
     58    $config->save();
     59  }
     60
     61  public function getFriends($limit = null, $isRandom = false)
     62  {
     63    $q = Doctrine::getTable('MemberRelationship')->createQuery()
     64        ->where('member_id_to = ?', $this->getId())
     65        ->andWhere('is_friend = ?', true)
     66        ->leftJoin('Member m ON member_id_from = m.member_id');
     67
     68    if (!is_null($limit))
     69    {
     70      $q->limit($limit);
     71    }
     72
     73    if ($isRandom)
     74    {
     75      $expr = new Doctrine_Expression('RANDOM()');
     76      $q->orderBy($expr);
     77    }
     78
     79    return $q->execute();
     80  }
     81 
     82  public function countFriends(Criteria $c = null)
     83  {
     84  /*
     85    if (!$c)
     86    {
     87      $c = new Criteria();
     88    }
     89    $c->add(MemberRelationshipPeer::MEMBER_ID_TO, $this->getId());
     90    $c->add(MemberRelationshipPeer::IS_FRIEND, true);
     91    $c->addJoin(MemberPeer::ID, MemberRelationshipPeer::MEMBER_ID_FROM);
     92    return MemberPeer::doCount($c);
     93    */
     94
     95    return 0;
     96  }
     97 
     98  public function getNameAndCount($format = '%s (%d)')
     99  {
     100    return sprintf($format, $this->getName(), $this->countFriends());
     101  }
     102 
     103  public function getJoinCommunities($limit = null, Criteria $c = null)
     104  {
     105  /*
     106    if (!$c)
     107    {
     108      $c = new Criteria();
     109    }
     110    return CommunityPeer::retrievesByMemberId($this->getId(), $limit, $c);
     111    */
     112
     113    return array();
     114  }
     115
     116  public function getFriendPreTo(Criteria $c = null)
     117  {
     118  /*
     119    if (!$c)
     120    {
     121      $c = new Criteria();
     122    }
     123    $c->add(MemberRelationshipPeer::IS_FRIEND_PRE, true);
     124    return $this->getMemberRelationshipsRelatedByMemberIdTo($c);
     125    */
     126
     127    return array();
     128  }
     129
     130  public function countFriendPreTo(Criteria $c = null)
     131  {
     132  /*
     133    if (!$c)
     134    {
     135      $c = new Criteria();
     136    }
     137    $c->add(MemberRelationshipPeer::IS_FRIEND_PRE, true);
     138    return $this->countMemberRelationshipsRelatedByMemberIdTo($c);
     139    */
     140
     141    return array();
     142  }
     143
     144  public function getFriendPreFrom(Criteria $c = null)
     145  {
     146  /*
     147    if (!$c)
     148    {
     149      $c = new Criteria();
     150    }
     151    $c->add(MemberRelationshipPeer::IS_FRIEND_PRE, true);
     152    return $this->getMemberRelationshipsRelatedByMemberIdFrom($c);
     153    */
     154
     155    return array();
     156  }
     157
     158  public function countFriendPreFrom(Criteria $c = null)
     159  {
     160  /*
     161    if (!$c)
     162    {
     163      $c = new Criteria();
     164    }
     165    $c->add(MemberRelationshipPeer::IS_FRIEND_PRE, true);
     166    return $this->countMemberRelationshipsRelatedByMemberIdFrom($c);
     167    */
     168
     169    return 0;
     170  }
     171
     172  public function getImage()
     173  {
     174  /*
     175    $c = new Criteria();
     176    $c->addDescendingOrderByColumn(MemberImagePeer::IS_PRIMARY, true);
     177    $result = $this->getMemberImages($c);
     178
     179    if ($result)
     180    {
     181      return array_shift($result);
     182    }
     183    */
     184
     185    return false;
     186  }
     187 
     188  public function getImageFileName()
     189  {
     190  /*
     191    if($this->getImage())
     192    {
     193      return $this->getImage()->getFile();
     194    }
     195    */
     196    return false;
     197  }
     198
     199  public function updateLastLoginTime()
     200  {
     201    $this->setConfig('lastLogin', time());
     202  }
     203
     204  public function getLastLoginTime()
     205  {
     206    return $this->getConfig('lastLogin');
     207  }
     208
     209  public function isOnBlackList()
     210  {
     211  /*
     212    $uid = $this->getConfig('mobile_uid');
     213    if ($uid)
     214    {
     215      return (bool)BlacklistPeer::retrieveByUid($uid);
     216    }
     217    */
     218
     219    return false;
     220  }
     221
     222  public function getInvitingMembers()
     223  {
     224//    return MemberPeer::retrivesByInviteMemberId($this->getId());
     225
     226    return array();
     227  }
     228
     229  public function getInviteMember()
     230  {
     231//    return MemberPeer::retrieveByPk($this->getInviteMemberId());
     232
     233    return null;
     234  }
     235
     236  public function getEmailAddress($isPriorityMobile = null)
     237  {
     238    if (is_null($isPriorityMobile))
     239    {
     240      $isPriorityMobile = false;
     241      if (sfConfig::get('sf_app') == 'mobile_frontend')
     242      {
     243        $isPriorityMobile = true;
     244      }
     245    }
     246
     247    $memberPcAddress     = $this->getConfig('pc_address');
     248    $memberMobileAddress = $this->getConfig('mobile_address');
     249
     250    if ($memberMobileAddress && ($isPriorityMobile || !$memberPcAddress))
     251    {
     252      return $memberMobileAddress;
     253    }
     254
     255    if ($memberPcAddress)
     256    {
     257      return $memberPcAddress;
     258    }
     259
     260    return null;
     261  }
     262
     263  public function getEmailAddresses()
     264  {
     265    $result = array();
     266
     267    $memberPcAddress     = $this->getConfig('pc_address');
     268    $memberMobileAddress = $this->getConfig('mobile_address');
     269
     270    if ($memberPcAddress)
     271    {
     272      $result[] = $memberPcAddress;
     273    }
     274
     275    if ($memberMobileAddress)
     276    {
     277      $result[] = $memberMobileAddress;
     278    }
     279
     280    return $result;
     281  }
    9282}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/MemberConfigTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class MemberConfigTable extends Doctrine_Table
    612{
     13  protected $results;
     14
     15  public function retrieveByNameAndMemberId($name, $memberId, $force = false)
     16  {
     17    $results = $this->getResultsByMemberId($memberId, $force);
     18    return (isset($results[$name])) ? $results[$name] : null;
     19  }
     20
     21  public function retrieveByNameAndValue($name, $value)
     22  {
     23    return $this->createQuery()
     24      ->where('name = ?', $name)
     25      ->andWhere('value = ?', $value)
     26      ->fetchOne();
     27  }
     28
     29  public function retrievesByName($name)
     30  {
     31    return $this->createQuery()
     32      ->where('name = ?', $name)
     33      ->execute();
     34  }
     35
     36  public function deleteDuplicatedPre($memberId, $name, $value)
     37  {
     38    $memberConfig = $this->retrieveByNameAndMemberId($name.'_pre', $memberId);
     39    if ($memberConfig) {
     40      $memberConfig->delete();
     41    }
     42
     43    $memberConfigSettings = sfConfig::get('openpne_member_config');
     44    if ($memberConfigSettings[$name]['IsUnique']) {
     45      $memberConfigs = $this->retrievesByName($name.'_pre');
     46      foreach ($memberConfigs as $config) {
     47        if ($value === $config->getValue()) {
     48          if (!$config->getMember()->getIsActive()) {
     49            $config->getMember()->delete();
     50          }
     51          $config->delete();
     52        }
     53      }
     54    }
     55  }
     56
     57  protected function getResultsByMemberId($memberId, $force = false)
     58  {
     59    if (!isset($this->results[$memberId]) || $force)
     60    {
     61      $objects = $this->createQuery()
     62        ->where('member_id = ?', $memberId)
     63        ->execute();
     64
     65      $this->results[$memberId] = array();
     66      foreach ($objects as $object)
     67      {
     68        $this->results[$memberId][$object->getName()] = $object;
     69      }
     70    }
     71
     72    return $this->results[$memberId];
     73  }
    774
    875}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/MemberProfile.class.php

    r11208 r11219  
    22
    33/**
    4  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    59 */
     10
    611class MemberProfile extends BaseMemberProfile
    712{
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/MemberProfileTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class MemberProfileTable extends Doctrine_Table
    612{
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/MemberRelationshipTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class MemberRelationshipTable extends Doctrine_Table
    612{
     13  public function retrieveByFromAndTo($memberIdFrom, $memberIdTo)
     14  {
     15    return $this->createQuery()
     16      ->where('member_id_from = ?', $memberIdFrom)
     17      ->andWhere('member_id_to = ?', $memberIdTo)
     18      ->fetchOne();
     19  }
    720
     21  public function retrievesByMemberIdFrom($memberId)
     22  {
     23    return $this->createQuery()
     24      ->where('member_id_from = ?', $memberId)
     25      ->execute();
     26  }
     27
     28  public function getFriendListPager($memberId, $page = 1, $size = 20)
     29  {
     30  /*
     31    $c = new Criteria();
     32    $c->add(self::MEMBER_ID_TO, $memberId);
     33    $c->add(self::IS_FRIEND, true);
     34    $c->addJoin(MemberPeer::ID, self::MEMBER_ID_FROM);
     35
     36    $pager = new sfPropelPager('Member', $size);
     37    $pager->setCriteria($c);
     38    $pager->setPage($page);
     39    $pager->init();
     40
     41    return $pager;
     42    */
     43    return null;
     44  }
     45
     46  public function getFriendMemberIds($memberId)
     47  {
     48    return $this->createQuery()
     49      ->select('id')
     50      ->where('member_id_to = ?', $memberId)
     51      ->andWhere('is_friend = ?', true)
     52      ->fetchArray();
     53  }
    854}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/MemberTable.class.php

    r11208 r11219  
    55class MemberTable extends Doctrine_Table
    66{
     7  public function createPre()
     8  {
     9    $member = new Member();
     10    $member->setIsActive(false);
     11    $member->save();
    712
     13    return $member;
     14  }
    815}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/Navigation.class.php

    r11208 r11219  
    66class Navigation extends BaseNavigation
    77{
    8 
    98}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/NavigationTable.class.php

    r11208 r11219  
    11<?php
     2
    23/**
    3  * This class has been auto-generated by the Doctrine ORM Framework
     4 * This file is part of the OpenPNE package.
     5 * (c) OpenPNE Project (http://www.openpne.jp/)
     6 *
     7 * For the full copyright and license information, please view the LICENSE
     8 * file and the NOTICE file that were distributed with this source code.
    49 */
     10
    511class NavigationTable extends Doctrine_Table
    612{
     13  public function retrieveByType($type)
     14  {
     15    return $this->createQuery()
     16      ->where('type = ?', $type)
     17      ->orderBy('sort_order')
     18      ->execute();
     19  }
    720
     21  public function retrieveTypes($isMobile)
     22  {
     23    $result = array();
     24
     25    if ($isMobile)
     26    {
     27      $defaultTypes = array(
     28        'mobile_global',
     29        'mobile_home',
     30        'mobile_home_side',
     31        'mobile_friend',
     32        'mobile_community',
     33      );
     34    }
     35    else
     36    {
     37      $defaultTypes = array(
     38        'insecure_global',
     39        'secure_global',
     40        'default',
     41        'friend',
     42        'community',
     43      );
     44    }
     45
     46    $result = $this->createQuery()
     47      ->select('type')
     48      ->groupBy('type')
     49      ->orderBy('sort_order')
     50      ->fetchArray();
     51
     52    return array_unique(array_merge($defaultTypes, $result));
     53  }
    854}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseAdminUser.class.php

    r11208 r11219  
    66abstract class BaseAdminUser extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('admin_user');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('username', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    13     $this->hasColumn('password', 'string', 40, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '40'));
    14   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('admin_user');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('username', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     13        $this->hasColumn('password', 'string', 40, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '40'));
     14
     15        $this->option('charset', 'utf8');
     16    }
    1517
    1618}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseBlacklist.class.php

    r11208 r11219  
    66abstract class BaseBlacklist extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('blacklist');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('uid', 'string', 32, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '32'));
    13     $this->hasColumn('memo', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    14   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('blacklist');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('uid', 'string', 32, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '32'));
     13        $this->hasColumn('memo', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
     14
     15        $this->option('charset', 'utf8');
     16    }
    1517
    1618}
  • 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}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseCommunityCategory.class.php

    r11208 r11219  
    66abstract class BaseCommunityCategory extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('community_category');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('lft_key', 'integer', 4, array('type' => 'integer', 'default' => '0', 'length' => '4'));
    13     $this->hasColumn('rht_key', 'integer', 4, array('type' => 'integer', 'default' => '0', 'length' => '4'));
    14     $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    15     $this->hasColumn('is_allow_member_community', 'integer', 1, array('type' => 'integer', 'default' => '1', 'notnull' => true, 'length' => '1'));
    16     $this->hasColumn('tree_key', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    17     $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    18   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('community_category');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('lft_key', 'integer', 4, array('type' => 'integer', 'default' => '0', 'length' => '4'));
     13        $this->hasColumn('rht_key', 'integer', 4, array('type' => 'integer', 'default' => '0', 'length' => '4'));
     14        $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     15        $this->hasColumn('is_allow_member_community', 'integer', 1, array('type' => 'integer', 'default' => '1', 'notnull' => true, 'length' => '1'));
     16        $this->hasColumn('tree_key', 'integer', 4, array('type' => 'integer', 'length' => '4'));
     17        $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    1918
    20   public function setUp()
    21   {
    22     $this->hasMany('Community', array('local' => 'id',
    23                                       'foreign' => 'community_category_id'));
    24   }
     19        $this->option('charset', 'utf8');
     20    }
     21
     22    public function setUp()
     23    {
     24        $this->hasMany('Community', array('local' => 'id',
     25                                          'foreign' => 'community_category_id'));
     26    }
    2527}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseCommunityConfig.class.php

    r11208 r11219  
    66abstract class BaseCommunityConfig extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('community_config');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('community_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    14     $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('community_config');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('community_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     14        $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Community', array('local' => 'community_id',
    20                                      'foreign' => 'id'));
    21   }
     16        $this->option('charset', 'utf8');
     17    }
     18
     19    public function setUp()
     20    {
     21        $this->hasOne('Community', array('local' => 'community_id',
     22                                         'foreign' => 'id'));
     23    }
    2224}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseCommunityMember.class.php

    r11208 r11219  
    66abstract class BaseCommunityMember extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('community_member');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('community_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    14     $this->hasColumn('position', 'string', 32, array('type' => 'string', 'default' => '', 'length' => '32'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('community_member');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('community_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     14        $this->hasColumn('position', 'string', 32, array('type' => 'string', 'default' => '', 'length' => '32'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Community', array('local' => 'community_id',
    20                                      'foreign' => 'id'));
     16        $this->option('charset', 'utf8');
     17    }
    2118
    22     $this->hasOne('Member', array('local' => 'member_id',
    23                                   'foreign' => 'id'));
    24   }
     19    public function setUp()
     20    {
     21        $this->hasOne('Community', array('local' => 'community_id',
     22                                         'foreign' => 'id'));
     23
     24        $this->hasOne('Member', array('local' => 'member_id',
     25                                      'foreign' => 'id'));
     26    }
    2527}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseFile.class.php

    r11208 r11219  
    66abstract class BaseFile extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('file');
    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('type', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    14     $this->hasColumn('original_filename', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('file');
     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('type', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     14        $this->hasColumn('original_filename', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasMany('Community', array('local' => 'id',
    20                                       'foreign' => 'file_id'));
     16        $this->option('charset', 'utf8');
     17    }
    2118
    22     $this->hasMany('MemberImage', array('local' => 'id',
     19    public function setUp()
     20    {
     21        $this->hasMany('Community', array('local' => 'id',
     22                                          'foreign' => 'file_id'));
     23
     24        $this->hasMany('MemberImage', array('local' => 'id',
     25                                            'foreign' => 'file_id'));
     26
     27        $this->hasMany('FileBin', array('local' => 'id',
    2328                                        'foreign' => 'file_id'));
    2429
    25     $this->hasMany('FileBin', array('local' => 'id',
    26                                     'foreign' => 'file_id'));
    27 
    28     $timestampable0 = new Doctrine_Template_Timestampable();
    29     $this->actAs($timestampable0);
    30   }
     30        $timestampable0 = new Doctrine_Template_Timestampable();
     31        $this->actAs($timestampable0);
     32    }
    3133}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseFileBin.class.php

    r11208 r11219  
    66abstract class BaseFileBin extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('file_bin');
    11     $this->hasColumn('file_id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'length' => '4'));
    12     $this->hasColumn('bin', 'blob', 2147483647, array('type' => 'blob', 'length' => '2147483647'));
    13   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('file_bin');
     11        $this->hasColumn('file_id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'length' => '4'));
     12        $this->hasColumn('bin', 'blob', 2147483647, array('type' => 'blob', 'length' => '2147483647'));
    1413
    15   public function setUp()
    16   {
    17     $this->hasOne('File', array('local' => 'file_id',
    18                                 'foreign' => 'id'));
    19   }
     14        $this->option('charset', 'utf8');
     15    }
     16
     17    public function setUp()
     18    {
     19        $this->hasOne('File', array('local' => 'file_id',
     20                                    'foreign' => 'id'));
     21    }
    2022}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseGadget.class.php

    r11208 r11219  
    66abstract class BaseGadget extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('gadget');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('type', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    13     $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    14     $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('gadget');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('type', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     13        $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     14        $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasMany('GadgetConfig', array('local' => 'id',
    20                                          'foreign' => 'gadget_id'));
    21   }
     16        $this->option('charset', 'utf8');
     17    }
     18
     19    public function setUp()
     20    {
     21        $this->hasMany('GadgetConfig', array('local' => 'id',
     22                                             'foreign' => 'gadget_id'));
     23    }
    2224}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseGadgetConfig.class.php

    r11208 r11219  
    66abstract class BaseGadgetConfig extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('gadget_config');
    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('gadget_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    14     $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('gadget_config');
     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('gadget_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
     14        $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Gadget', array('local' => 'gadget_id',
    20                                   'foreign' => 'id'));
    21   }
     16        $this->option('charset', 'utf8');
     17    }
     18
     19    public function setUp()
     20    {
     21        $this->hasOne('Gadget', array('local' => 'gadget_id',
     22                                      'foreign' => 'id'));
     23    }
    2224}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseMember.class.php

    r11208 r11219  
    66abstract class BaseMember extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('member');
    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('is_active', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    14     $this->hasColumn('invite_member_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('member');
     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('is_active', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     14        $this->hasColumn('invite_member_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Member', array('local' => 'invite_member_id',
    20                                   'foreign' => 'id'));
     16        $this->option('charset', 'utf8');
     17    }
    2118
    22     $this->hasMany('CommunityMember', array('local' => 'id',
     19    public function setUp()
     20    {
     21        $this->hasOne('Member', array('local' => 'invite_member_id',
     22                                      'foreign' => 'id'));
     23
     24        $this->hasMany('CommunityMember', array('local' => 'id',
     25                                                'foreign' => 'member_id'));
     26
     27        $this->hasMany('MemberRelationship', array('local' => 'id',
     28                                                   'foreign' => 'member_id_to'));
     29
     30        $this->hasMany('MemberConfig', array('local' => 'id',
     31                                             'foreign' => 'member_id'));
     32
     33        $this->hasMany('MemberImage', array('local' => 'id',
    2334                                            'foreign' => 'member_id'));
    2435
    25     $this->hasMany('MemberRelationship', array('local' => 'id',
    26                                                'foreign' => 'member_id_to'));
     36        $this->hasMany('MemberProfile', array('local' => 'id',
     37                                              'foreign' => 'member_id'));
    2738
    28     $this->hasMany('MemberConfig', array('local' => 'id',
    29                                          'foreign' => 'member_id'));
    30 
    31     $this->hasMany('MemberImage', array('local' => 'id',
    32                                         'foreign' => 'member_id'));
    33 
    34     $this->hasMany('MemberProfile', array('local' => 'id',
    35                                           'foreign' => 'member_id'));
    36 
    37     $timestampable0 = new Doctrine_Template_Timestampable();
    38     $this->actAs($timestampable0);
    39   }
     39        $timestampable0 = new Doctrine_Template_Timestampable();
     40        $this->actAs($timestampable0);
     41    }
    4042}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseMemberConfig.class.php

    r11208 r11219  
    66abstract class BaseMemberConfig extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('member_config');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    14     $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('member_config');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('name', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     14        $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Member', array('local' => 'member_id',
    20                                   'foreign' => 'id'));
    21   }
     16        $this->option('charset', 'utf8');
     17    }
     18
     19    public function setUp()
     20    {
     21        $this->hasOne('Member', array('local' => 'member_id',
     22                                      'foreign' => 'id'));
     23    }
    2224}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseMemberImage.class.php

    r11208 r11219  
    66abstract class BaseMemberImage extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('member_image');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('file_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    14     $this->hasColumn('is_primary', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('member_image');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('file_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     14        $this->hasColumn('is_primary', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Member', array('local' => 'member_id',
    20                                   'foreign' => 'id'));
     16        $this->option('charset', 'utf8');
     17    }
    2118
    22     $this->hasOne('File', array('local' => 'file_id',
    23                                 'foreign' => 'id'));
    24   }
     19    public function setUp()
     20    {
     21        $this->hasOne('Member', array('local' => 'member_id',
     22                                      'foreign' => 'id'));
     23
     24        $this->hasOne('File', array('local' => 'file_id',
     25                                    'foreign' => 'id'));
     26    }
    2527}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseMemberProfile.class.php

    r11208 r11219  
    66abstract class BaseMemberProfile extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('member_profile');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('profile_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    14     $this->hasColumn('profile_option_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    15     $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    16     $this->hasColumn('public_flag', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    17   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('member_profile');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('member_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('profile_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     14        $this->hasColumn('profile_option_id', 'integer', 4, array('type' => 'integer', 'length' => '4'));
     15        $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
     16        $this->hasColumn('public_flag', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    1817
    19   public function setUp()
    20   {
    21     $this->hasOne('Member', array('local' => 'member_id',
    22                                   'foreign' => 'id'));
     18        $this->option('charset', 'utf8');
     19    }
    2320
    24     $this->hasOne('Profile', array('local' => 'profile_id',
    25                                    'foreign' => 'id'));
     21    public function setUp()
     22    {
     23        $this->hasOne('Member', array('local' => 'member_id',
     24                                      'foreign' => 'id'));
    2625
    27     $this->hasOne('ProfileOption', array('local' => 'profile_option_id',
    28                                          'foreign' => 'id'));
     26        $this->hasOne('Profile', array('local' => 'profile_id',
     27                                       'foreign' => 'id'));
    2928
    30     $nestedset0 = new Doctrine_Template_NestedSet(array('hasManyRoots' => true, 'rootColumnName' => 'tree_key'));
    31     $this->actAs($nestedset0);
    32   }
     29        $this->hasOne('ProfileOption', array('local' => 'profile_option_id',
     30                                             'foreign' => 'id'));
     31
     32        $nestedset0 = new Doctrine_Template_NestedSet(array('hasManyRoots' => true, 'rootColumnName' => 'tree_key'));
     33        $this->actAs($nestedset0);
     34    }
    3335}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseMemberRelationship.class.php

    r11208 r11219  
    66abstract class BaseMemberRelationship extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('member_relationship');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('member_id_to', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('member_id_from', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    14     $this->hasColumn('is_friend', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    15     $this->hasColumn('is_friend_pre', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    16     $this->hasColumn('is_access_block', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    17   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('member_relationship');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('member_id_to', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('member_id_from', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     14        $this->hasColumn('is_friend', 'integer', 1, array('type' => 'integer', 'length' => '1'));
     15        $this->hasColumn('is_friend_pre', 'integer', 1, array('type' => 'integer', 'length' => '1'));
     16        $this->hasColumn('is_access_block', 'integer', 1, array('type' => 'integer', 'length' => '1'));
    1817
    19   public function setUp()
    20   {
    21     $this->hasOne('Member', array('local' => 'member_id_to',
    22                                   'foreign' => 'id'));
     18        $this->option('charset', 'utf8');
     19    }
    2320
    24     $this->hasOne('Member as Member_2', array('local' => 'member_id_from',
    25                                               'foreign' => 'id'));
    26   }
     21    public function setUp()
     22    {
     23        $this->hasOne('Member', array('local' => 'member_id_to',
     24                                      'foreign' => 'id'));
     25
     26        $this->hasOne('Member as Member_2', array('local' => 'member_id_from',
     27                                                  'foreign' => 'id'));
     28    }
    2729}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseNavigation.class.php

    r11208 r11219  
    66abstract class BaseNavigation extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('navigation');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('caption', 'string', 2147483647, array('type' => 'string', 'notnull' => true, 'length' => '2147483647'));
    13     $this->hasColumn('type', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
    14     $this->hasColumn('uri', 'string', 2147483647, array('type' => 'string', 'notnull' => true, 'length' => '2147483647'));
    15     $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    16   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('navigation');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('caption', 'string', 2147483647, array('type' => 'string', 'notnull' => true, 'length' => '2147483647'));
     13        $this->hasColumn('type', 'string', 64, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '64'));
     14        $this->hasColumn('uri', 'string', 2147483647, array('type' => 'string', 'notnull' => true, 'length' => '2147483647'));
     15        $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    1716
    18   public function setUp()
    19   {
    20     $i18n0 = new Doctrine_Template_I18n(array('fields' => array(0 => 'caption')));
    21     $this->actAs($i18n0);
    22   }
     17        $this->option('charset', 'utf8');
     18    }
     19
     20    public function setUp()
     21    {
     22        $i18n0 = new Doctrine_Template_I18n(array('fields' => array(0 => 'caption'), 'length' => '5'));
     23        $this->actAs($i18n0);
     24    }
    2325}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseProfile.class.php

    r11208 r11219  
    66abstract class BaseProfile extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('profile');
    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('is_required', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    14     $this->hasColumn('is_unique', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    15     $this->hasColumn('is_edit_public_flag', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    16     $this->hasColumn('default_public_flag', 'integer', 1, array('type' => 'integer', 'default' => '1', 'notnull' => true, 'length' => '1'));
    17     $this->hasColumn('form_type', 'string', 32, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '32'));
    18     $this->hasColumn('value_type', 'string', 32, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '32'));
    19     $this->hasColumn('is_disp_regist', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    20     $this->hasColumn('is_disp_config', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    21     $this->hasColumn('is_disp_search', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
    22     $this->hasColumn('value_regexp', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    23     $this->hasColumn('value_min', 'string', 32, array('type' => 'string', 'length' => '32'));
    24     $this->hasColumn('value_max', 'string', 32, array('type' => 'string', 'length' => '32'));
    25     $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    26     $this->hasColumn('caption', 'string', 2147483647, array('type' => 'string', 'notnull' => true, 'length' => '2147483647'));
    27     $this->hasColumn('info', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    28   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('profile');
     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('is_required', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     14        $this->hasColumn('is_unique', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     15        $this->hasColumn('is_edit_public_flag', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     16        $this->hasColumn('default_public_flag', 'integer', 1, array('type' => 'integer', 'default' => '1', 'notnull' => true, 'length' => '1'));
     17        $this->hasColumn('form_type', 'string', 32, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '32'));
     18        $this->hasColumn('value_type', 'string', 32, array('type' => 'string', 'default' => '', 'notnull' => true, 'length' => '32'));
     19        $this->hasColumn('is_disp_regist', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     20        $this->hasColumn('is_disp_config', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     21        $this->hasColumn('is_disp_search', 'integer', 1, array('type' => 'integer', 'default' => '0', 'notnull' => true, 'length' => '1'));
     22        $this->hasColumn('value_regexp', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
     23        $this->hasColumn('value_min', 'string', 32, array('type' => 'string', 'length' => '32'));
     24        $this->hasColumn('value_max', 'string', 32, array('type' => 'string', 'length' => '32'));
     25        $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
     26        $this->hasColumn('caption', 'string', 2147483647, array('type' => 'string', 'notnull' => true, 'length' => '2147483647'));
     27        $this->hasColumn('info', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    2928
    30   public function setUp()
    31   {
    32     $this->hasMany('MemberProfile', array('local' => 'id',
    33                                           'foreign' => 'profile_id'));
     29        $this->option('charset', 'utf8');
     30    }
    3431
    35     $this->hasMany('ProfileOption', array('local' => 'id',
    36                                           'foreign' => 'profile_id'));
     32    public function setUp()
     33    {
     34        $this->hasMany('MemberProfile', array('local' => 'id',
     35                                              'foreign' => 'profile_id'));
    3736
    38     $i18n0 = new Doctrine_Template_I18n(array('fields' => array(0 => 'caption', 1 => 'info')));
    39     $this->actAs($i18n0);
    40   }
     37        $this->hasMany('ProfileOption', array('local' => 'id',
     38                                              'foreign' => 'profile_id'));
     39
     40        $i18n0 = new Doctrine_Template_I18n(array('fields' => array(0 => 'caption', 1 => 'info'), 'length' => '5'));
     41        $this->actAs($i18n0);
     42    }
    4143}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseProfileOption.class.php

    r11208 r11219  
    66abstract class BaseProfileOption extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('profile_option');
    11     $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
    12     $this->hasColumn('profile_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
    13     $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    14     $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    15   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('profile_option');
     11        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'primary' => true, 'autoincrement' => true, 'length' => '4'));
     12        $this->hasColumn('profile_id', 'integer', 4, array('type' => 'integer', 'notnull' => true, 'length' => '4'));
     13        $this->hasColumn('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
     14        $this->hasColumn('sort_order', 'integer', 4, array('type' => 'integer', 'length' => '4'));
    1615
    17   public function setUp()
    18   {
    19     $this->hasOne('Profile', array('local' => 'profile_id',
    20                                    'foreign' => 'id'));
     16        $this->option('charset', 'utf8');
     17    }
    2118
    22     $this->hasMany('MemberProfile', array('local' => 'id',
    23                                           'foreign' => 'profile_option_id'));
     19    public function setUp()
     20    {
     21        $this->hasOne('Profile', array('local' => 'profile_id',
     22                                       'foreign' => 'id'));
    2423
    25     $i18n0 = new Doctrine_Template_I18n(array('fields' => array(0 => 'value')));
    26     $this->actAs($i18n0);
    27   }
     24        $this->hasMany('MemberProfile', array('local' => 'id',
     25                                              'foreign' => 'profile_option_id'));
     26
     27        $i18n0 = new Doctrine_Template_I18n(array('fields' => array(0 => 'value'), 'length' => '5'));
     28        $this->actAs($i18n0);
     29    }
    2830}
  • OpenPNE3/branches/goto_doctrine/lib/model/doctrine/base/BaseSnsConfig.class.php

    r11208 r11219  
    66abstract class BaseSnsConfig extends sfDoctrineRecord
    77{
    8   public function setTableDefinition()
    9   {
    10     $this->setTableName('sns_config');
    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('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
    14   }
     8    public function setTableDefinition()
     9    {
     10        $this->setTableName('sns_config');
     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('value', 'string', 2147483647, array('type' => 'string', 'length' => '2147483647'));
     14
     15        $this->option('charset', 'utf8');
     16    }
    1517
    1618}
  • OpenPNE3/branches/goto_doctrine/lib/user/sfOpenPNESecurityUser.class.php

    r10122 r11219  
    128128  public function getMember()
    129129  {
    130     return MemberPeer::retrieveByPk($this->getMemberId());
     130    return Doctrine::getTable('Member')->find($this->getMemberId());
    131131  }
    132132
  • OpenPNE3/branches/goto_doctrine/lib/validator/opAuthValidatorMemberConfig.class.php

    r10003 r11219  
    5959      $fieldName = $configName;
    6060    }
    61     $memberConfig = MemberConfigPeer::retrieveByNameAndValue($configName, $values[$fieldName]);
     61    $memberConfig = Doctrine::getTable('MemberConfig')->retrieveByNameAndValue($configName, $values[$fieldName]);
    6262    if ($memberConfig)
    6363    {
  • OpenPNE3/branches/goto_doctrine/lib/validator/opAuthValidatorMemberConfigAndPassword.class.php

    r10003 r11219  
    4141    }
    4242
    43     $valid_password = MemberConfigPeer::retrieveByNameAndMemberId('password', $values['member']->getId())->getValue();
     43    $valid_password = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('password', $values['member']->getId())->getValue();
    4444    opActivateBehavior::enable();
    4545    if (md5($values['password']) !== $valid_password)
Note: See TracChangeset for help on using the changeset viewer.