本文整理汇总了PHP中User_group::update方法的典型用法代码示例。如果您正苦于以下问题:PHP User_group::update方法的具体用法?PHP User_group::update怎么用?PHP User_group::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_group
的用法示例。
在下文中一共展示了User_group::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateGroupUrls
function updateGroupUrls()
{
printfnq("Updating group URLs...\n");
$group = new User_group();
if ($group->find()) {
while ($group->fetch()) {
try {
printfv("Updating group {$group->nickname}...");
$orig = User_group::getKV('id', $group->id);
if (!empty($group->original_logo)) {
$group->original_logo = Avatar::url(basename($group->original_logo));
$group->homepage_logo = Avatar::url(basename($group->homepage_logo));
$group->stream_logo = Avatar::url(basename($group->stream_logo));
$group->mini_logo = Avatar::url(basename($group->mini_logo));
}
// XXX: this is a hack to see if a group is local or not
$localUri = common_local_url('groupbyid', array('id' => $group->id));
if ($group->getUri() != $localUri) {
$group->mainpage = common_local_url('showgroup', array('nickname' => $group->nickname));
}
$group->update($orig);
printfv("DONE.");
} catch (Exception $e) {
echo "Can't update avatars for group " . $group->nickname . ": " . $e->getMessage();
}
}
}
}
示例2: updateGroup
protected static function updateGroup(User_group $group, ActivityObject $object, array $hints = array())
{
$orig = clone $group;
$group->nickname = self::getActivityObjectNickname($object, $hints);
$group->fullname = $object->title;
if (!empty($object->link)) {
$group->mainpage = $object->link;
} else {
if (array_key_exists('profileurl', $hints)) {
$group->mainpage = $hints['profileurl'];
}
}
// @todo tags from categories
$group->description = self::getActivityObjectBio($object, $hints);
$group->location = self::getActivityObjectLocation($object, $hints);
$group->homepage = self::getActivityObjectHomepage($object, $hints);
if ($group->id) {
// If no id, we haven't called insert() yet, so don't run update()
common_log(LOG_DEBUG, "Updating OStatus group {$group->id} from remote info {$object->id}: " . var_export($object, true) . var_export($hints, true));
$group->update($orig);
}
}
示例3: fixupGroupURI
function fixupGroupURI()
{
printfnq("Ensuring all groups have an URI...");
$group = new User_group();
$group->whereAdd('uri IS NULL');
if ($group->find()) {
while ($group->fetch()) {
$orig = User_group::staticGet('id', $group->id);
$group->uri = $group->getUri();
$group->update($orig);
}
}
printfnq("DONE.\n");
}