Skip to content

Commit c00cd90

Browse files
committed
添加注释
1 parent f238a23 commit c00cd90

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

services/Product.php

+8-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace fecshop\services;
1212

13+
use fecshop\services\product\ProductMongodb;
14+
use fecshop\services\product\ProductMysqldb;
1315
use yii\base\InvalidCallException;
1416
use yii\base\InvalidConfigException;
1517
use Yii;
@@ -35,23 +37,20 @@ class Product extends Service
3537
* 如果设置了路径,则使用自定义的路径
3638
*/
3739
public $storagePath = '';
40+
/**
41+
* @var ProductMongodb | ProductMysqldb 根据 $storage 及 $storagePath 配置的 Product 的实现
42+
*/
3843
protected $_product;
44+
/**
45+
* @var string 默认属性组名称
46+
*/
3947
protected $_defaultAttrGroup = 'default';
4048

4149
public function init()
4250
{
4351
parent::init();
4452
$currentService = $this->getStorageService($this);
4553
$this->_product = new $currentService();
46-
/*
47-
if ($this->storage == 'mongodb') {
48-
// 根据配置注入的config值,返回相应的class,譬如:\fecshop\services\product\ProductMongodb
49-
$currentService = $this->getStorageService($this);
50-
$this->_product = new $currentService();
51-
//}else if($this->storage == 'mysqldb'){
52-
//$this->_category = new CategoryMysqldb;
53-
}
54-
*/
5554
}
5655

5756

0 commit comments

Comments
 (0)