PHP Class AttachModel, thinksns

Inheritance: extends Model
Show file Open project: medz/thinksns-4

Protected Properties

Property Type Description
$fields
$tableName

Public Methods

Method Description
doEditAttach ( integer $id, string $type, string $title ) : array 删除附件信息,提供假删除功能
getAllExtensions ( ) : array 获取所有附件的扩展名
getAttachById ( integer $id ) : array 通过单个附件ID获取其附件信息
getAttachByIds ( array $ids, string $field = '*' ) : array 通过附件ID获取附件数据 - 不分页型
getAttachList ( array $map, string $field = '*', string $order = 'id DESC', integer $limit = 20 ) : array 获取附件列表 - 分页型
saveAttach ( $file )
upImageAttach ( $page = 1, $count = 100 ) 更新附件图片,保存图片的宽度和高度
upImageAttachCloud ( $page = 1, $count = 100 )
upload ( array $data = null, array $input_options = null, boolean $thumb = false ) : array 上传附件

Private Methods

Method Description
cloudAttachUpload ( $options )
cloudImageUpload ( $options )
localUpload ( $options )
saveInfo ( $upload_info, $options )

Method Details

doEditAttach() public method

删除附件信息,提供假删除功能
public doEditAttach ( integer $id, string $type, string $title ) : array
$id integer 附件ID
$type string 操作类型,若为delAttach则进行假删除操作,deleteAttach则进行彻底删除操作
$title string ???
return array 返回操作结果信息

getAllExtensions() public method

获取所有附件的扩展名
public getAllExtensions ( ) : array
return array 扩展名数组

getAttachById() public method

通过单个附件ID获取其附件信息
public getAttachById ( integer $id ) : array
$id integer 附件ID
return array 指定附件ID的附件信息

getAttachByIds() public method

通过附件ID获取附件数据 - 不分页型
public getAttachByIds ( array $ids, string $field = '*' ) : array
$ids array 附件ID数组
$field string 附件数据显示字段,默认为显示全部
return array 相关附件数据

getAttachList() public method

获取附件列表 - 分页型
public getAttachList ( array $map, string $field = '*', string $order = 'id DESC', integer $limit = 20 ) : array
$map array 查询条件
$field string 显示字段
$order string 排序条件,默认为id DESC
$limit integer 结果集个数,默认为20
return array 附件列表数据

saveAttach() public method

public saveAttach ( $file )

upImageAttach() public method

更新附件图片,保存图片的宽度和高度
public upImageAttach ( $page = 1, $count = 100 )

upImageAttachCloud() public method

public upImageAttachCloud ( $page = 1, $count = 100 )

upload() public method

上传附件
public upload ( array $data = null, array $input_options = null, boolean $thumb = false ) : array
$data array 附件相关信息
$input_options array 配置选项[不推荐修改, 默认使用后台的配置]
$thumb boolean 是否启用缩略图
return array 上传的附件的信息

Property Details

$fields protected property

protected $fields

$tableName protected property

protected $tableName