Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace app\models;
- use Yii;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- /**
- * CommentsForm is the model behind the comments form.
- */
- class Comments extends ActiveRecord
- {
- public static function tableName()
- {
- return 'comments';
- }
- public function rules()
- {
- return [
- /* nick and comment body are both required */
- [[ 'body'], 'required'],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'id' => Yii::t('app', 'ID'),
- 'body' => Yii::t('app', 'Body'),
- 'created_at' => Yii::t('app', 'Created At'),
- 'update_at' => Yii::t('app', 'Update At'),
- 'status' => Yii::t('app', 'Status'),
- ];
- }
- public function behaviors()
- {
- return [
- TimestampBehavior::className(),
- ];}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement