Created
May 18, 2014 17:47
-
-
Save nsanden/262d57b91aa0b6d158a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace common\models; | |
use Yii; | |
use yii\behaviors\TimestampBehavior; | |
use yii\db\ActiveRecord; | |
/** | |
* This is the model class for table "tbl_job". | |
* | |
* @property integer $id | |
* @property string $title | |
* @property string $description | |
* @property string $pay | |
* @property string $application_name | |
* @property string $application_url | |
* @property integer $expired | |
* @property string $updated | |
* @property string $created | |
*/ | |
class Job extends \yii\db\ActiveRecord | |
{ | |
/** | |
* @inheritdoc | |
*/ | |
public static function tableName() | |
{ | |
return 'tbl_job'; | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function rules() | |
{ | |
return [ | |
[['title', 'description', 'pay', 'application_name', 'application_url'], 'required'], | |
[['description'], 'string'], | |
[['updated', 'created', 'expired'], 'safe'], | |
[['title', 'pay'], 'string', 'max' => 255] | |
]; | |
} | |
public function behaviors() | |
{ | |
return [ | |
'timestamp' => [ | |
'class' => TimestampBehavior::className(), | |
'attributes' => [ | |
ActiveRecord::EVENT_BEFORE_INSERT => ['created', 'updated'], | |
ActiveRecord::EVENT_BEFORE_UPDATE => 'updated', | |
], | |
], | |
]; | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function attributeLabels() | |
{ | |
return [ | |
'id' => 'ID', | |
'title' => 'Title', | |
'description' => 'Description', | |
'pay' => 'Pay', | |
'expired' => 'Expired', | |
'application_name' => 'Application Name', | |
'application_url' => 'Application URL', | |
'updated' => 'Updated', | |
'created' => 'Created', | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment