add Telegram bot id dialogs table and API methods
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models\profile\forms;
|
||||
use frontend\modules\api\models\profile\User;
|
||||
use yii\base\Model;
|
||||
|
||||
class ProfileChangeEmailForm extends Model
|
||||
{
|
||||
public $newEmail;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['newEmail'], 'string'],
|
||||
[['newEmail'], 'required'],
|
||||
[['newEmail'], 'email'],
|
||||
['newEmail', 'unique', 'targetAttribute' => 'email', 'targetClass' => User::class],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function formName(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models\profile\forms;
|
||||
use yii\base\Model;
|
||||
|
||||
class ProfileChangePasswordForm extends Model
|
||||
{
|
||||
|
||||
public $password;
|
||||
public $newPassword;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['password', 'newPassword'], 'string'],
|
||||
[['password', 'newPassword'], 'required'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function formName(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models\profile\forms;
|
||||
|
||||
use yii\base\Model;
|
||||
|
||||
class ProfileChangePersonalDataForm extends Model
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $newUsername;
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['newUsername'], 'string', 'max' => 255],
|
||||
[['newUsername'], 'required'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function formName(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user