本文整理匯總了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;
}