当前位置: 首页>>代码示例>>PHP>>正文


PHP Streams::updateAvatar方法代码示例

本文整理汇总了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);
    }
}
开发者ID:atirjavid,项目名称:Platform,代码行数:8,代码来源:Users_Contact_removeExecute.php

示例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);
}
开发者ID:dmitriz,项目名称:Platform,代码行数:9,代码来源:Users_Contact_removeExecute.php

示例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);
    }
}
开发者ID:dmitriz,项目名称:Platform,代码行数:13,代码来源:Users_Contact_saveExecute.php

示例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;
 }
开发者ID:AndreyTepaykin,项目名称:Platform,代码行数:36,代码来源:Access.php


注:本文中的Streams::updateAvatar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。