Commit c4f409df4a6c14ddecf5b2b12e2912adafb22ee1
1 parent
bb8cf49c
+ Social model для авторизации юзеров
Showing
1 changed file
with
48 additions
and
0 deletions
Show diff stats
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace common\models; | ||
| 4 | + | ||
| 5 | +use Yii; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * This is the model class for table "social". | ||
| 9 | + * | ||
| 10 | + * @property integer $social_id | ||
| 11 | + * @property string $social_name | ||
| 12 | + * @property integer $social_user_id | ||
| 13 | + * @property integer $user_id | ||
| 14 | + */ | ||
| 15 | +class Social extends \yii\db\ActiveRecord | ||
| 16 | +{ | ||
| 17 | + /** | ||
| 18 | + * @inheritdoc | ||
| 19 | + */ | ||
| 20 | + public static function tableName() | ||
| 21 | + { | ||
| 22 | + return 'social'; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * @inheritdoc | ||
| 27 | + */ | ||
| 28 | + public function rules() | ||
| 29 | + { | ||
| 30 | + return [ | ||
| 31 | + [['social_user_id', 'user_id'], 'integer'], | ||
| 32 | + [['social_name'], 'string', 'max' => 255] | ||
| 33 | + ]; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * @inheritdoc | ||
| 38 | + */ | ||
| 39 | + public function attributeLabels() | ||
| 40 | + { | ||
| 41 | + return [ | ||
| 42 | + 'social_id' => Yii::t('app', 'Social ID'), | ||
| 43 | + 'social_name' => Yii::t('app', 'Social Name'), | ||
| 44 | + 'social_user_id' => Yii::t('app', 'Social User ID'), | ||
| 45 | + 'user_id' => Yii::t('app', 'User ID'), | ||
| 46 | + ]; | ||
| 47 | + } | ||
| 48 | +} |