add Telegram bot id dialogs table and API methods
This commit is contained in:
33
frontend/modules/api/models/tg_bot/UserTgBotDialog.php
Normal file
33
frontend/modules/api/models/tg_bot/UserTgBotDialog.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models\tg_bot;
|
||||
|
||||
use frontend\modules\api\models\profile\User;
|
||||
use yii\db\ActiveQuery;
|
||||
|
||||
class UserTgBotDialog extends \common\models\UserTgBotDialog
|
||||
{
|
||||
public function fields(): array
|
||||
{
|
||||
return [
|
||||
'user_id',
|
||||
'dialog_id',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function extraFields(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ActiveQuery
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->hasOne(User::class, ['id' => 'user_id']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user