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


PHP Avatar::deleteFromProfile方法代码示例

本文整理汇总了PHP中Avatar::deleteFromProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP Avatar::deleteFromProfile方法的具体用法?PHP Avatar::deleteFromProfile怎么用?PHP Avatar::deleteFromProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Avatar的用法示例。


在下文中一共展示了Avatar::deleteFromProfile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 function delete($useWhere = false)
 {
     $this->_deleteNotices();
     $this->_deleteSubscriptions();
     $this->_deleteTags();
     $this->_deleteBlocks();
     $this->_deleteAttentions();
     Avatar::deleteFromProfile($this, true);
     // Warning: delete() will run on the batch objects,
     // not on individual objects.
     $related = array('Reply', 'Group_member');
     Event::handle('ProfileDeleteRelated', array($this, &$related));
     foreach ($related as $cls) {
         $inst = new $cls();
         $inst->profile_id = $this->id;
         $inst->delete();
     }
     $localuser = User::getKV('id', $this->id);
     if ($localuser instanceof User) {
         $localuser->delete();
     }
     return parent::delete($useWhere);
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:23,代码来源:Profile.php

示例2: newAvatar

 protected function newAvatar(Profile $profile, $url, $filename, $mediatype)
 {
     // Clear out old avatars, won't do anything if there are none
     Avatar::deleteFromProfile($profile);
     // throws exception if unable to fetch
     $this->fetchRemoteUrl($url, Avatar::path($filename));
     $avatar = new Avatar();
     $avatar->profile_id = $profile->id;
     $avatar->original = 1;
     // this is an original/"uploaded" avatar
     $avatar->mediatype = $mediatype;
     $avatar->filename = $filename;
     $avatar->width = $this->avatarsize;
     $avatar->height = $this->avatarsize;
     $avatar->created = common_sql_now();
     $id = $avatar->insert();
     if (empty($id)) {
         common_log(LOG_WARNING, __METHOD__ . " Couldn't insert avatar - " . $e->getMessage());
         common_log_db_error($avatar, 'INSERT', __FILE__);
         throw new ServerException('Could not insert avatar');
     }
     common_debug(__METHOD__ . " - Saved new avatar for {$profile->id}.");
     return $avatar;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:24,代码来源:twitterimport.php

示例3: deleteAvatar

 /**
  * Get rid of the current avatar.
  *
  * @return void
  */
 function deleteAvatar()
 {
     $user = common_current_user();
     $profile = $user->getProfile();
     Avatar::deleteFromProfile($profile);
     // TRANS: Success message for deleting a user avatar.
     $this->showForm(_('Avatar deleted.'), true);
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:13,代码来源:avatarsettings.php

示例4: delete

 function delete($useWhere = false)
 {
     // just in case it hadn't been done before... (usually set before adding deluser to queue handling!)
     if (!$this->hasRole(Profile_role::DELETED)) {
         $this->grantRole(Profile_role::DELETED);
     }
     $this->_deleteNotices();
     $this->_deleteSubscriptions();
     $this->_deleteTags();
     $this->_deleteBlocks();
     $this->_deleteAttentions();
     Avatar::deleteFromProfile($this, true);
     // Warning: delete() will run on the batch objects,
     // not on individual objects.
     $related = array('Reply', 'Group_member');
     Event::handle('ProfileDeleteRelated', array($this, &$related));
     foreach ($related as $cls) {
         $inst = new $cls();
         $inst->profile_id = $this->id;
         $inst->delete();
     }
     $localuser = User::getKV('id', $this->id);
     if ($localuser instanceof User) {
         $localuser->delete();
     }
     return parent::delete($useWhere);
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:27,代码来源:Profile.php

示例5: deleteAvatar

 /**
  * Get rid of the current avatar.
  *
  * @return void
  */
 function deleteAvatar()
 {
     Avatar::deleteFromProfile($this->scoped);
     // TRANS: Success message for deleting a user avatar.
     return _('Avatar deleted.');
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:11,代码来源:avatarsettings.php


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