Advertisement
nazmiwafiy

Contact.php

Dec 6th, 2018
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <?php
  2.  
  3. namespace backend\modules\user\models;
  4.  
  5. use Yii;
  6. use yii\behaviors\TimestampBehavior;
  7.  
  8. /**
  9.  * This is the model class for table "tbl_contact".
  10.  *
  11.  * @property integer $id
  12.  * @property string $name
  13.  * @property string $email
  14.  * @property integer $created_at
  15.  * @property integer $updated_at
  16.  */
  17. class Contact extends \yii\db\ActiveRecord
  18. {
  19.     /**
  20.      * @inheritdoc
  21.      */
  22.     public static function tableName()
  23.     {
  24.         return 'tbl_contact';//{{%contact}}
  25.     }
  26.  
  27.     /**
  28.      * {@inheritdoc}
  29.      */
  30.     public function behaviors()
  31.     {
  32.         return [
  33.             TimestampBehavior::className(),
  34.         ];
  35.     }
  36.  
  37.     /**
  38.      * @inheritdoc
  39.      */
  40.     public function rules()
  41.     {
  42.         return [
  43.             [['name', 'email'], 'required'],
  44.             [['created_at', 'updated_at'], 'integer'],
  45.             [['name', 'email'], 'string', 'max' => 50],
  46.         ];
  47.     }
  48.  
  49.     /**
  50.      * @inheritdoc
  51.      */
  52.     public function attributeLabels()
  53.     {
  54.         return [
  55.             'name' => 'Name',
  56.             'email' => 'Email',
  57.         ];
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement