'Яндекс.Деньги', self::TYPE_QIWI => 'Qiwi' ]; } /** * @inheritdoc */ public static function tableName() { return 'wallets'; } /** * @inheritdoc */ public function rules() { return [ [['type_id', 'wallet_id', 'login', 'password'], 'required'], [['type_id', 'site_id', 'status'], 'integer'], [['balance'], 'number'], [['tm_last_balance', 'tm_last_transaction', 'tm_last_transaction_out'], 'safe'], [['wallet_id', 'password', 'login'], 'string', 'max' => 255], [['phone'], 'string', 'max' => 11], ['comment', 'safe'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'type_id' => 'Тип', 'site_id' => 'Сайт', 'wallet_id' => 'Кошелек', 'login' => 'Логин', 'password' => 'Пароль', 'balance' => 'Баланс', 'tm_last_balance' => 'Дата получения баланса', 'tm_last_transaction' => 'Приход', 'tm_last_transaction_out' => 'Расход', 'phone' => 'Номер телефона', 'comment' => 'Комментарии', 'status' => 'Статус' ]; } public function getSite() { return $this->hasOne(Site::className(), ['id' => 'site_id']); } }