add product
This commit is contained in:
@@ -69,4 +69,20 @@ class ProductCategory extends \common\models\BaseFitnessActiveRecord
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
||||
* */
|
||||
public static function read($forceIncludeObjectWithId = null){
|
||||
$categories = null;
|
||||
|
||||
if ( $forceIncludeObjectWithId == null){
|
||||
$categories = ProductCategory::find()->andWhere(['status' => ProductCategory::STATUS_ACTIVE])->all();
|
||||
}else{
|
||||
$categories = ProductCategory::find()->andWhere( ['or', ['status' => ProductCategory::STATUS_ACTIVE], ['id_product_category' => $forceIncludeObjectWithId ] ])->all();
|
||||
}
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user