You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.2 KiB

<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "{{%attr_group}}".
*
* @property integer $id
* @property integer $store_id
* @property string $attr_group_name
* @property integer $is_delete
*/
class AttrGroup extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%attr_group}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['store_id', 'attr_group_name'], 'required'],
[['store_id', 'is_delete'], 'integer'],
[['attr_group_name'], 'string', 'max' => 255],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'store_id' => 'Store ID',
'attr_group_name' => 'Attr Group Name',
'is_delete' => 'Is Delete',
];
}
private $attrList;
public function getAttrList()
{
if ($this->attrList) {
return $this->attrList;
}
$this->attrList = Attr::findAll(['is_delete' => 0, 'attr_group_id' => $this->id]);
return $this->attrList;
}
}