mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
76
models/PhoneRequest.php
Normal file
76
models/PhoneRequest.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use app\components\FindPhoneValidator;
|
||||
use Yii;
|
||||
use yii\behaviors\AttributeBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
/**
|
||||
* This is the model class for table "phone_request".
|
||||
*
|
||||
* @property integer $id
|
||||
* @property integer $user_id
|
||||
* @property string $tm
|
||||
* @property string $ip
|
||||
* @property string $data
|
||||
* @property string $wallet
|
||||
* @property string $contact
|
||||
* @property integer $status
|
||||
*/
|
||||
class PhoneRequest extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'phone_request';
|
||||
}
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'user_id' => [
|
||||
'class' => AttributeBehavior::className(),
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['user_id'],
|
||||
],
|
||||
'value' => Yii::$app->request->isConsoleRequest?"":\Yii::$app->getUser()->getId(),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['data'], 'required'],
|
||||
['data', FindPhoneValidator::className()],
|
||||
[['user_id', 'status'], 'integer'],
|
||||
[['tm'], 'safe'],
|
||||
[['data'], 'string'],
|
||||
[['ip', 'wallet', 'contact'], 'string', 'max' => 255],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'user_id' => 'User ID',
|
||||
'tm' => 'Tm',
|
||||
'ip' => 'Ip',
|
||||
'data' => 'Введите адрес страницы Вконтакте, Facebook, Instagram или email',
|
||||
'wallet' => 'Кошелек',
|
||||
'contact' => 'Контактная информация',
|
||||
'status' => 'Status',
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue