本文整理匯總了PHP中Streams::updateAvatars方法的典型用法代碼示例。如果您正苦於以下問題:PHP Streams::updateAvatars方法的具體用法?PHP Streams::updateAvatars怎麽用?PHP Streams::updateAvatars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Streams
的用法示例。
在下文中一共展示了Streams::updateAvatars方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: afterRemoveExecute
/**
* @method afterRemoveExcecute
* @param {Db_Result} $result
* @param {Db_Query} $query
* @return {Db_Result}
*/
function afterRemoveExecute($result, $query)
{
$stream = $this;
// if the above call threw an exception, then we will not be doing the following.
Q_Utils::sendToNode(array("Q/method" => "Streams/Stream/remove", "stream" => Q::json_encode($stream->toArray())));
/**
* @event Streams/remove/$streamType {after}
* @param {Streams_Stream} stream
* @param {string} asUserId
*/
Q::event("Streams/remove/{$stream->type}", compact('stream', 'result'), 'after');
if ($this->name !== 'Streams/user/firstName' and $this->name !== 'Streams/user/lastName') {
return $result;
}
// Update all avatars corresponding to access rows for this stream
$taintedAccess = Streams_Access::select('*')->where(array('publisherId' => $this->publisherId, 'streamName' => $this->name))->fetchDbRows();
Streams::updateAvatars($this->publisherId, $taintedAccess, $this, true);
return $result;
}
示例2: 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;
}