本文整理汇总了PHP中Streams::updateAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP Streams::updateAvatar方法的具体用法?PHP Streams::updateAvatar怎么用?PHP Streams::updateAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Streams
的用法示例。
在下文中一共展示了Streams::updateAvatar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Streams_after_Users_Contact_removeExecute
function Streams_after_Users_Contact_removeExecute($params)
{
// Update avatar as viewed by everyone who was in that contacts list
$contacts = Streams::$cache['contacts_removed'];
foreach ($contacts as $contact) {
Streams::updateAvatar($contact->contactUserId, $contact->userId);
}
}
示例2: Streams_after_Users_Contact_removeExecute
function Streams_after_Users_Contact_removeExecute($params)
{
// Update avatar as viewed by everyone who was in that contacts list
$contacts = Streams::$cache['contacts_removed'];
foreach ($contacts as $contact) {
Streams::updateAvatar($contact->contactUserId, $contact->userId);
}
Streams_Message::post(null, $contact->userId, 'Streams/contacts', array('type' => 'Streams/contacts/removed', 'instructions' => array('contacts' => Db::exportArray($contacts))), true);
}
示例3: Streams_before_Users_Contact_saveExecute
function Streams_before_Users_Contact_saveExecute($params)
{
$contacts = array($params['row']);
// the new values about to be written
if ($params['query']->type === Db_Query::TYPE_UPDATE) {
// we are updating an existing contact
$contacts = array_merge($contacts, Users_Contact::select('*')->where($params['where'])->limit(1)->fetchDbRows());
}
// Update avatar as viewed by everyone who was in that contacts list
foreach ($contacts as $contact) {
Streams::updateAvatar($contact->contactUserId, $contact->userId);
}
}
示例4: afterRemoveExecute
/**
* Keeps Access table consistent on row deletion and update avatar
* @method afterRemoveExecute
* @param {Db_Result} $result
* Query result
* @param {array} $query
* The query which has been excecuted
* @return {Db_Result}
*/
function afterRemoveExecute($result, $query)
{
if (!empty($this->ofUserId)) {
// Removed an access for a specific user
Streams::updateAvatar($this->ofUserId, $this->publisherId);
return $result;
}
if (empty($this->ofContactLabel)) {
return $result;
}
// Update all avatars corresponding to access rows for this stream
$tainted_access = Streams_Access::select('*')->where(array('publisherId' => $this->publisherId, 'streamName' => $this->streamName))->fetchDbRows();
$found = false;
foreach ($tainted_access as $ca) {
if ($ca->ofContactLabel === $this->ofContactLabel) {
// this should never really happen, since the row was just deleted
$found = true;
$ca->set('removed', true);
}
}
if (!$found) {
$this->set('removed', true);
$tainted_access[] = $this;
}
Streams::updateAvatars($this->publisherId, $tainted_access, $this->streamName);
return $result;
}