28 lines
650 B
PHP
28 lines
650 B
PHP
<?php
|
|
|
|
namespace common\models\oldDb;
|
|
|
|
use yii\behaviors\TimestampBehavior;
|
|
use yii\db\ActiveRecord;
|
|
|
|
class DoctorArticle extends \common\modelsgii\oldDb\DoctorArticle
|
|
{
|
|
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
[
|
|
'class' => TimestampBehavior::class,
|
|
'attributes' => [
|
|
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
|
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
|
],
|
|
],
|
|
];
|
|
}
|
|
|
|
public function getCategories()
|
|
{
|
|
return $this->hasOne(Categories::class,['id'=>'cid']);
|
|
}
|
|
} |