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

Changeset 11691


Ignore:
Timestamp:
May 19, 2009, 11:59:40 AM (13 years ago)
Author:
ebihara
Message:

removed the code depend on Propel

Location:
OpenPNE3/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_backend/modules/community/lib/DefaultCommunityForm.class.php

    r11200 r11691  
    3333  public function save()
    3434  {
    35     $community = CommunityPeer::retrieveByPk($this->getValue('id'));
     35    $community = Doctrine::getTable('Community')->find($this->getValue('id'));
    3636
    3737    if (!$community)
     
    4040    }
    4141
    42     $communityConfig = CommunityConfigPeer::retrieveByNameAndCommunityId('is_default', $community->getId());
     42    $communityConfig = Doctrine::getTable('CommunityConfig')->retrieveByNameAndCommunityId('is_default', $community->getId());
    4343
    4444    if (!$communityConfig)
     
    4848    $communityConfig->setCommunity($community);
    4949    $communityConfig->setName('is_default');
    50     $communityConfig->setValue(true);
     50    $communityConfig->setValue(1);
    5151    $communityConfig->save();
     52
    5253    return true;
    5354  }
  • OpenPNE3/trunk/lib/action/sfOpenPNEFriendAction.class.php

    r11584 r11691  
    9494    }
    9595
    96     $this->member = MemberPeer::retrieveByPk($this->id);
     96    $this->member = Doctrine::getTable('Member')->find($this->id);
     97
    9798    return sfView::INPUT;
    9899  }
  • OpenPNE3/trunk/lib/config/sfOpenPNEApplicationConfiguration.class.php

    r11575 r11691  
    320320  }
    321321
    322   protected function setBehaviors()
    323   {
    324     sfPropelBehavior::registerHooks('activate', array (
    325       'Peer:doSelectStmt:doSelectStmt' => array('opActivateBehavior', 'doSelectStmt'),
    326       'Peer:doCount:doCount'           => array('opActivateBehavior', 'doCount'),
    327     ));
    328   }
    329 
    330322  protected function setConfigHandlers()
    331323  {
  • OpenPNE3/trunk/lib/model/doctrine/Member.class.php

    r11689 r11691  
    9797    $q->where('member_id_to = ?', $this->getId());
    9898    $q->addWhere('is_friend_pre = ?', true);
     99
    99100    return $q->execute();
    100101  }
    101102
    102   public function countFriendPreTo(Criteria $c = null)
    103   {
    104   /*
    105     if (!$c)
    106     {
    107       $c = new Criteria();
    108     }
    109     $c->add(MemberRelationshipPeer::IS_FRIEND_PRE, true);
    110     return $this->countMemberRelationshipsRelatedByMemberIdTo($c);
    111     */
    112 
    113     return array();
    114   }
    115 
    116   public function getFriendPreFrom(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->getMemberRelationshipsRelatedByMemberIdFrom($c);
    125     */
    126 
    127     return array();
    128   }
    129 
    130   public function countFriendPreFrom(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->countMemberRelationshipsRelatedByMemberIdFrom($c);
    139     */
    140 
    141     return 0;
     103  public function countFriendPreTo(Doctrine_Query $q = null)
     104  {
     105    if (!$q)
     106    {
     107      $q = Doctrine::getTable('MemberRelationship')->createQuery();
     108    }
     109    $q->where('member_id_to = ?', $this->getId());
     110    $q->addWhere('is_friend_pre = ?', true);
     111
     112    return $q->count();
     113  }
     114
     115  public function getFriendPreFrom(Doctrine_Query $q = null)
     116  {
     117    if (!$q)
     118    {
     119      $q = Doctrine::getTable('MemberRelationship')->createQuery();
     120    }
     121    $q->where('member_id_from = ?', $this->getId());
     122    $q->addWhere('is_friend_pre = ?', true);
     123
     124    return $q->execute();
     125  }
     126
     127  public function countFriendPreFrom(Doctrine_Query $q = null)
     128  {
     129    if (!$q)
     130    {
     131      $q = Doctrine::getTable('MemberRelationship')->createQuery();
     132    }
     133    $q->where('member_id_from = ?', $this->getId());
     134    $q->addWhere('is_friend_pre = ?', true);
     135
     136    return $q->count();
    142137  }
    143138
Note: See TracChangeset for help on using the changeset viewer.