<?php
namespace common\models;
use common\components\Helper;
use yii\base\Model;

/**
 * Created by IntelliJ IDEA.
 * User: rocho
 * Date: 2018.12.17.
 * Time: 6:14
 */

class CardEventRegistrationForm extends Model
{
    public $card_number;
    public $event_id;
    public $registration;

    public function rules()
    {
        return [
            [['card_number'], 'required' ],
            [['card_number'], 'validateFormat' ]
        ];
    }

    public function validateFormat(){
        $this->card_number = Helper::fixAsciiChars( $this->card_number );
    }

    public function getIsNewRecord(){
        return true;
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'card_number' => \Yii::t('event', 'Card Number'),
        ];
    }


}
