本文整理汇总了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");
}