Changeset 14912
- Timestamp:
- 06/30/08 19:02:19 (5 years ago)
- Location:
- events/phpframework/rhaco/trunk
- Files:
-
- 2 added
- 8 modified
-
library/PhwittrUser.php (modified) (2 diffs)
-
library/model/StandBy.php (added)
-
library/model/table/FollowTable.php (modified) (1 diff)
-
library/model/table/FollowingTable.php (modified) (2 diffs)
-
library/model/table/ReplytoTable.php (modified) (1 diff)
-
library/model/table/StandByTable.php (added)
-
library/model/table/StatusTable.php (modified) (1 diff)
-
library/model/table/TmpRegistrationTable.php (modified) (1 diff)
-
library/model/table/UserTable.php (modified) (4 diffs)
-
setup/project.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/rhaco/trunk/library/PhwittrUser.php
r14541 r14912 134 134 $response = array('error' => 1, 'message' => 'you already following '. $followUser->getName()); 135 135 } else { 136 $followed = $this->dbUtil->get(new Follow(), new C(Q::eq(Follow::columnUserId(), $followUser->id), Q::eq(Follow::columnFollowId(), $user->id))); 136 137 // 登録処理 137 if($followUser->privateFlag){ 138 // TODO: request ! 138 if($followUser->privateFlag && !Variable::istype('TableObjectBase', $followed)){ 139 $request = new StandBy(); 140 $request->setUserId($user->id); 141 $request->setRequestId($followUser->id); 142 if($request->save($this->dbUtil)){ 143 $response = array('error' => 0, 'message' => 'You requested a follow from '. $followUser->name. '.'); 144 } 139 145 } else { 140 146 $follow = new Follow(); … … 167 173 if($user->privateFlag){ 168 174 $this->dbUtil->delete(new Follow(), new C(Q::eq(Follow::columnFollowId(), $user->getId()), Q::eq(Follow::columnUserId(), $followId))); 169 // TODO: requestに降格 175 $request = new StandBy(); 176 $request->setUserId($followUser->id); 177 $request->setRequestId($user->id); 178 $request->save($this->dbUtil); 170 179 } 171 180 if($this->dbUtil->delete($follow)){ -
events/phpframework/rhaco/trunk/library/model/table/FollowTable.php
r13838 r14912 4 4 Rhaco::import("database.model.DbConnection"); 5 5 /** 6 * #ignore 6 7 * 7 8 */ -
events/phpframework/rhaco/trunk/library/model/table/FollowingTable.php
r13838 r14912 5 5 Rhaco::import("model.User"); 6 6 /** 7 * #ignore 7 8 * 8 9 */ 9 10 class FollowingTable extends User{ 11 var $dependStandBys; 12 var $users; 10 13 11 14 function table(){ … … 51 54 return new Column(parent::columnFollowerCount()); 52 55 } 56 function setDependStandBys($value){ 57 $this->dependStandBys = $value; 58 } 59 function getDependStandBys(){ 60 return $this->dependStandBys; 61 } 62 function setUsers($value){ 63 $this->users = $value; 64 } 65 function getUsers(){ 66 return $this->users; 67 } 53 68 } 54 69 ?> -
events/phpframework/rhaco/trunk/library/model/table/ReplytoTable.php
r13849 r14912 5 5 Rhaco::import("model.User"); 6 6 /** 7 * #ignore 7 8 * 8 9 */ -
events/phpframework/rhaco/trunk/library/model/table/StatusTable.php
r13849 r14912 4 4 Rhaco::import("database.model.DbConnection"); 5 5 /** 6 * #ignore 6 7 * 7 8 */ -
events/phpframework/rhaco/trunk/library/model/table/TmpRegistrationTable.php
r13965 r14912 4 4 Rhaco::import("database.model.DbConnection"); 5 5 /** 6 * #ignore 6 7 * 7 8 */ -
events/phpframework/rhaco/trunk/library/model/table/UserTable.php
r13838 r14912 4 4 Rhaco::import("database.model.DbConnection"); 5 5 /** 6 * #ignore 6 7 * 7 8 */ … … 33 34 var $dependStatuss; 34 35 var $dependFollows; 36 var $dependStandBys; 37 var $followings; 35 38 36 39 … … 66 69 $column = new Column("column=id,variable=id,type=serial,size=22,primary=true,"); 67 70 $column->label(Message::_("id")); 68 $column->depend("Status::UserId","Follow::UserId" );71 $column->depend("Status::UserId","Follow::UserId","StandBy::UserId"); 69 72 return $column; 70 73 } … … 284 287 return $this->dependFollows; 285 288 } 289 function setDependStandBys($value){ 290 $this->dependStandBys = $value; 291 } 292 function getDependStandBys(){ 293 return $this->dependStandBys; 294 } 295 function setFollowings($value){ 296 $this->followings = $value; 297 } 298 function getFollowings(){ 299 return $this->followings; 300 } 286 301 } 287 302 ?> -
events/phpframework/rhaco/trunk/setup/project.xml
r13965 r14912 36 36 <column name="created_at" type="timestamp" default="sysdate" /> 37 37 </map> 38 <!-- follow待ち --> 39 <map name="request" class="stand_by"> 40 <column name="id" /> 41 <column name="user_id" type="integer" reference="user.id" uniquewith="request_id" /> 42 <column name="request_id" type="integer" reference="following.id" uniquewith="user_id" require="true" /> 43 <column name="created_at" type="timestamp" default="sysdate" /> 44 </map> 38 45 39 46 <!-- status -->
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)