add product

This commit is contained in:
2015-09-24 22:14:09 +02:00
parent fcc18d79f6
commit a2b835225a
15 changed files with 229 additions and 80 deletions

View File

@@ -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;
}
}