本文整理匯總了PHP中Group_member::whereAdd方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group_member::whereAdd方法的具體用法?PHP Group_member::whereAdd怎麽用?PHP Group_member::whereAdd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Group_member
的用法示例。
在下文中一共展示了Group_member::whereAdd方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getGroups
function getGroups()
{
$groups = array();
$gm = new Group_member();
$gm->profile_id = $this->user->id;
if (!empty($this->after)) {
$gm->whereAdd("created > '" . common_sql_date($this->after) . "'");
}
if ($gm->find()) {
while ($gm->fetch()) {
$groups[] = clone $gm;
}
}
return $groups;
}
示例2: initGroupMemberURI
function initGroupMemberURI()
{
printfnq("Ensuring all group memberships have a URI...");
$mem = new Group_member();
$mem->whereAdd('uri IS NULL');
if ($mem->find()) {
while ($mem->fetch()) {
try {
$mem->decache();
$mem->query(sprintf('update group_member set uri = "%s" ' . 'where profile_id = %d ' . 'and group_id = %d ', Group_member::newURI($mem->profile_id, $mem->group_id, $mem->created), $mem->profile_id, $mem->group_id));
} catch (Exception $e) {
common_log(LOG_ERR, "Error updated membership URI: " . $e->getMessage());
}
}
}
printfnq("DONE.\n");
}