本文整理汇总了PHP中ElggObject::deleteIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggObject::deleteIcon方法的具体用法?PHP ElggObject::deleteIcon怎么用?PHP ElggObject::deleteIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggObject
的用法示例。
在下文中一共展示了ElggObject::deleteIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteIcon
/**
* Deletes the previous uploaded icon
*
* @param string $type Icon type
* @return bool
*/
public function deleteIcon($type = 'icon')
{
if ($type == 'icon') {
$fh = new \ElggFile();
$fh->owner_guid = $this->guid;
$icon_sizes = elgg_get_icon_sizes('object', 'event');
foreach ($icon_sizes as $name => $info) {
$fh->setFilename("{$name}.jpg");
if ($fh->exists()) {
$fh->delete();
}
}
unset($this->icontime);
}
return parent::deleteIcon($type);
}
示例2: file_handle_object_delete
/**
* Handle an object being deleted
*
* @param string $event Event name
* @param string $type Event type
* @param ElggObject $file The object deleted
* @return void
*/
function file_handle_object_delete($event, $type, ElggObject $file)
{
if (!$file instanceof ElggFile) {
return;
}
if (!$file->guid) {
// this is an ElggFile used as temporary API
return;
}
$file->deleteIcon();
}