hyperf-chat/app/Model/UsersEmoticon.php

55 lines
970 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
declare (strict_types=1);
namespace App\Model;
/**
* 表情包收藏数据表模型
*
* @property int $id 收藏ID
* @property int $user_id 用户ID
* @property string $emoticon_ids 表情包ID多个用英文逗号拼接
*
* @package App\Model
*/
class UsersEmoticon extends BaseModel
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'users_emoticon';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id',
'emoticon_ids'
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'user_id' => 'integer'
];
/**
*
* @param string $value
* @return string
*/
public function getEmoticonIdsAttribute($value)
{
return explode(',', $value);
}
}