| Current Path : /var/www/html/crm/models/ |
| Current File : /var/www/html/crm/models/Brand.php |
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "brand".
*
* @property int $id
* @property string $uuid
* @property string $name
* @property int $status
* @property string $created_dt
* @property int $created_by
* @property string $updated_dt
* @property int $updated_by
*/
class Brand extends \yii\db\ActiveRecord {
/**
* {@inheritdoc}
*/
public static function tableName() {
return 'brand';
}
/**
* {@inheritdoc}
*/
public function rules() {
return [
[['uuid', 'name'], 'required'],
[['status', 'created_by', 'updated_by'], 'integer'],
[['created_dt', 'updated_dt'], 'safe'],
[['name'], 'string', 'max' => 255],
[['uuid'], 'unique'],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels() {
return [
'id' => 'ID',
'uuid' => 'Uuid',
'name' => 'Brand Name',
'status' => 'Status',
'created_dt' => 'Created Dt',
'created_by' => 'Created By',
'updated_dt' => 'Updated Dt',
'updated_by' => 'Updated By',
'sme_id' => 'Owner',
'entity' => 'Entity'
];
}
public function getname($id) {
if (($model = static::findOne($id)) !== null) {
return $model->name;
}
}
}