Changeset 4016
- Timestamp:
- 05/16/07 12:54:00 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfBBPlugin/lib/model/sfBBPost.php
r4015 r4016 10 10 class sfBBPost extends BasesfBBPost 11 11 { 12 private 13 /** 14 * The post's creator. 15 * 16 * @var sfGuardUser 17 * @access private 18 */ 19 $user = null; 20 12 21 public function setTitle($title) 13 22 { … … 45 54 $c->addJoin(sfGuardUserPeer::ID, sfBBPostPeer::USER_ID, Criteria::LEFT_JOIN); 46 55 $c->addAscendingOrderByColumn(sfBBPostPeer::CREATED_AT); 47 return sfBBPostPeer::doSelectJoinsfGuardUser($c); 56 $replies = sfBBPostPeer::doSelectJoinsfGuardUser($c); 57 58 foreach ($replies as $reply) 59 { 60 $reply->setUser($reply->getsfGuardUser()); 61 } 62 63 return $replies; 64 } 65 66 /** 67 * Shortcut method to retrieve post's creator. 68 * 69 * @return sfGuardUser The post's creator. 70 */ 71 public function getUser() 72 { 73 if (!$this->user) 74 { 75 $c = new Criteria(); 76 $c->add(sfGuardUserPeer::ID, $this->getUserId()); 77 $this->user = sfGuardUserPeer::doSelectOne($c); 78 } 79 80 return $this->user; 81 } 82 83 public function setUser($user) 84 { 85 $this->user = $user; 48 86 } 49 87 } plugins/sfBBPlugin/modules/sfBB/templates/viewThreadSuccess.php
r4015 r4016 8 8 <tr> 9 9 <td> 10 <?php echo $thread->get sfGuardUser() ?>10 <?php echo $thread->getUser() ?> 11 11 </td> 12 12 <td> … … 19 19 <tr> 20 20 <td> 21 <?php echo $reply->get sfGuardUser() ?>21 <?php echo $reply->getUser() ?> 22 22 </td> 23 23 <td>