55 lines
2.6 KiB
PHP
55 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Models\File;
|
|
|
|
use Dipper\Foundation\Core\Model;
|
|
use Dipper\Foundation\Snowflake\SnowflakeHelpers;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* App\Models\File\File
|
|
*
|
|
* @property int $id 附件全局唯一ID
|
|
* @property string $hash 文件 hash
|
|
* @property string $disk 盘符
|
|
* @property string $filename 文件名
|
|
* @property string $origin_filename 原始文件名
|
|
* @property string $mimetype mime type
|
|
* @property int $filesize 文件大小
|
|
* @property int $width 宽度
|
|
* @property int $height 高度
|
|
* @property float $duration 持续时间
|
|
* @property int $thumb 是否有缩略图 0:无 1:有
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\File\FileWith[] $file_withs
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereDisk($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereDuration($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereFilename($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereFilesize($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereHash($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereHeight($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereMimetype($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereOriginFilename($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereThumb($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\File\File whereWidth($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class File extends Model
|
|
{
|
|
use SnowflakeHelpers;
|
|
|
|
protected $table = 'files';
|
|
|
|
public function file_withs(): HasMany
|
|
{
|
|
return $this->hasMany(FileWith::class, 'file_id', 'id');
|
|
}
|
|
}
|