Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace app\modules\proposal\models;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- use app\modules\proposal\ProposalModule;
- use app\modules\routes\models\Cities;
- /**
- * This is the model class for table "proposal".
- *
- * @property integer $id
- * @property string $name
- * @property string $phone
- * @property string $email
- * @property string $weight
- * @property string $from
- * @property string $to
- * @property integer $shipping_date
- * @property string $message
- * @property string $url
- * @property integer $created_at
- * @property integer $updated_at
- * @property integer $status
- * @property string $source
- */
- class Proposal extends ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%proposal}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- ['shipping_date', 'date', 'timestampAttribute' => 'shipping_date', 'format' => 'php: d.m.Y'],
- [['created_at', 'updated_at', 'status'], 'integer'],
- [['message'], 'string'],
- [['name', 'phone', 'email', 'weight', 'from', 'to', 'url', 'source'], 'string', 'max' => 255],
- [['name', 'phone', 'email', 'weight', 'from', 'to', 'url', 'source'], 'default', 'value' => null],
- ['email', 'email'],
- //[['mass', 'capacity'], 'number']
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => ProposalModule::t('module', 'PROPOSAL_NAME'),
- 'phone' => ProposalModule::t('module', 'PROPOSAL_PHONE'),
- 'email' => ProposalModule::t('module', 'PROPOSAL_EMAIL'),
- 'weight' => ProposalModule::t('module', 'PROPOSAL_WEIGHT'),
- 'from' => ProposalModule::t('module', 'PROPOSAL_FROM'),
- 'to' => ProposalModule::t('module', 'PROPOSAL_TO'),
- 'shipping_date' => ProposalModule::t('module', 'P_SHIPPING_DATE'),
- 'message' => ProposalModule::t('module', 'PROPOSAL_MESSAGE'),
- 'url' => ProposalModule::t('module', 'PROPOSAL_URL'),
- 'created_at' => ProposalModule::t('module', 'P_CREATED_AT'),
- 'updated_at' => ProposalModule::t('module', 'P_UPDATED_AT'),
- 'status' => ProposalModule::t('module', 'PROPOSAL_STATUS'),
- 'source' => ProposalModule::t('module', 'PROPOSAL_SOURCE'),
- ];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement