本文整理匯總了PHP中C::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP C::create方法的具體用法?PHP C::create怎麽用?PHP C::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類C
的用法示例。
在下文中一共展示了C::create方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getFriendsAndMyStatuses
public function getFriendsAndMyStatuses($userId, $params, $limit = null)
{
if ($limit === null) {
$limit = self::DEFAULT_ITEM_LIMIT;
}
$ids = Follower::getFriendIds($userId);
$ids[] = $userId;
$join = new Sabel_Db_Join("Status");
$paginator = new Paginator($join->add("Users"));
$paginator->setCondition(C::create(C::IN, "Users.uid", $ids));
$paginator->setDefaultOrder("Status.created_at", "desc");
return $paginator->build($limit, $params);
}
示例2: destroy
/**
* @transaction
*
* @param int $userId ユーザID
*
* @return Logics_Result
*/
public function destroy($userId)
{
$result = new Logics_Result();
$aUser = new User($userId);
if ($aUser->isSelected()) {
$or = new Sabel_Db_Condition_Or();
$or->add(C::create(C::EQUAL, "user_id", $aUser->id));
$or->add(C::create(C::EQUAL, "request_id", $aUser->id));
$request = new Request();
$request->delete($or);
$or = new Sabel_Db_Condition_Or();
$or->add(C::create(C::EQUAL, "user_id", $aUser->id));
$or->add(C::create(C::EQUAL, "follow_id", $aUser->id));
$follower = new Follower();
$follower->delete($or);
$status = new Status();
$status->delete("user_id", $userId);
$aUser->save(array("delete_flag" => true));
}
return $result;
}