diff --git a/services/AdminUser.php b/services/AdminUser.php index fd87671d683c4782f807622aa473f256bf642a84..9a230ec63442c6796b8f1fad9484f6d7e503d63a 100644 --- a/services/AdminUser.php +++ b/services/AdminUser.php @@ -21,7 +21,7 @@ class AdminUser extends Service { #Yii::$service->adminUser->getIdAndNameArrByIds($ids) - public function getIdAndNameArrByIds($ids){ + protected function actionGetIdAndNameArrByIds($ids){ $user_coll = \fecadmin\models\AdminUser::find()->asArray()->select(['id','username'])->where([ 'in','id',$ids diff --git a/services/Blog.php b/services/Blog.php index b27b1c8954c01f63a94b43ef8359a99bef2e1d9d..b50d0af3cd25b5f288af439ceaf5e31e4e30f159 100644 --- a/services/Blog.php +++ b/services/Blog.php @@ -19,51 +19,51 @@ use fec\helpers\CSession; class Blog extends Service { - public function getCategoryMenu(){ + protected function actionGetCategoryMenu(){ } - public function getArticleList(){ + protected function actionGetArticleList(){ } - public function getCategoryArticleList(){ + protected function actionGetCategoryArticleList(){ } - public function getArticleById(){ + protected function actionGetArticleById(){ } - public function saveArticle(){ + protected function actionSaveArticle(){ } - public function deleteArticle(){ + protected function actionDeleteArticle(){ } - public function saveCategory(){ + protected function actionSaveCategory(){ } - public function deleteCategory(){ + protected function actionDeleteCategory(){ } - public function getCategoryById(){ + protected function actionGetCategoryById(){ } diff --git a/services/Cart.php b/services/Cart.php index ac3907cf178c4bb8a045d9c29199bd56ba65492f..b79eb6b0ff147eecf10fbe3699eedd04f3dc2ed0 100644 --- a/services/Cart.php +++ b/services/Cart.php @@ -33,24 +33,24 @@ class Cart extends Service * use session to save custom cart info, also ,you can config varibale $noLoginUserCartStorage ,save cart info to db. * */ - public function addProductToCart($item){ + protected function actionAddProductToCart($item){ } - public function getUserCartInfo(){ + protected function actionGetUserCartInfo(){ } - public function changeItemQty($sku){ + protected function actionChangeItemQty($sku){ } /** * merge cart , if current cart currency is not equals to user cart currency when user login account. */ - public function mergeCartAfterUserLogin(){ + protected function actionMergeCartAfterUserLogin(){ } @@ -59,7 +59,7 @@ class Cart extends Service * change current cart currency * 1. check if currency is allowed to change. */ - public function changeCartCurrency(){ + protected function actionChangeCartCurrency(){ } @@ -68,7 +68,7 @@ class Cart extends Service * @property $language|String * change current language , cart product language change to current language. */ - public function changeProductLanguage($language=''){ + protected function actionChangeProductLanguage($language=''){ } @@ -77,7 +77,7 @@ class Cart extends Service * @property $address|Array * save cart address.like,, customer name,tel,email,address ,,etc,,. */ - public function saveCartAddress($address){ + protected function actionSaveCartAddress($address){ } @@ -89,7 +89,7 @@ class Cart extends Service * 3.change shipping cost after change * */ - public function saveCartShipping($shippingId){ + protected function actionSaveCartShipping($shippingId){ } @@ -99,7 +99,7 @@ class Cart extends Service * 1.check if $paymentId is effective * 2.add or change payment to cart. */ - public function saveCartPayment($paymentId){ + protected function actionSaveCartPayment($paymentId){ } @@ -108,7 +108,7 @@ class Cart extends Service * $item_ids * remove cart items by $items_ids */ - public function removeItems($item_ids){ + protected function actionRemoveItems($item_ids){ } @@ -116,7 +116,7 @@ class Cart extends Service /** * clear cart product. */ - public function clearCart(){ + protected function actionClearCart(){ } @@ -124,7 +124,7 @@ class Cart extends Service /** * generate order by current Cart. */ - public function generateOrderByCart(){ + protected function actionGenerateOrderByCart(){ } @@ -135,7 +135,7 @@ class Cart extends Service * 2. get all item sku and custom option. * 3. add to cart like in product page ,click add to cart button. */ - public function addItemsByPendingOrder($order_id){ + protected function actionAddItemsByPendingOrder($order_id){ } diff --git a/services/Customer.php b/services/Customer.php index f4906da5d4879a409c64bac9663f9e75f43e4b37..b8f2d4dc939ea74112fafc106f2054c9a8d65897 100644 --- a/services/Customer.php +++ b/services/Customer.php @@ -22,7 +22,7 @@ class Customer extends Service * @property $data|Array * like :['email'=>'xxx@xxx.com','password'=>'xxxx'] */ - public function login($data){ + protected function actionLogin($data){ } @@ -33,7 +33,7 @@ class Customer extends Service * ,'sex','age', * ] */ - public function register($data){ + protected function actionRegister($data){ } @@ -43,7 +43,7 @@ class Customer extends Service * Get customer info by customerId, if customer id is empty, current customer id will be set, * if current customer id is empty , false will be return . */ - public function viewInfo($customerId = ''){ + protected function actionViewInfo($customerId = ''){ } @@ -54,7 +54,7 @@ class Customer extends Service * change customer password. * if $customer id is empty, it will be equals current customer id. */ - public function changePassword($password,$customerId=''){ + protected function actionChangePassword($password,$customerId=''){ } @@ -63,14 +63,14 @@ class Customer extends Service * @property $customerId|Array * ['firstname','lastname','password','customerId'] */ - public function changeNameAndPassword($data){ + protected function actionChangeNameAndPassword($data){ } /** * get current customer identify. */ - public function getCurrentAccount(){ + protected function actionGetCurrentAccount(){ return Yii::$app->user->identity->username; } diff --git a/services/FecshopLang.php b/services/FecshopLang.php index 2b6f347ec3c60950753bf4a8320fb716d8aded33..2d997eb0041fa100883e7b2376ed5392a091d77d 100644 --- a/services/FecshopLang.php +++ b/services/FecshopLang.php @@ -33,11 +33,11 @@ class Fecshoplang extends Service * @property $langCode|String , language 2 code, like :en ,fr ,es, * get language child language attr, like: title_fr */ - public function getLangAttrName($attrName,$langCode){ + protected function actionGetLangAttrName($attrName,$langCode){ return $attrName.'_'.$langCode; } - public function getDefaultLangAttrName($attrName){ + protected function actionGetDefaultLangAttrName($attrName){ return $attrName.'_'.$this->defaultLangCode; } @@ -47,7 +47,7 @@ class Fecshoplang extends Service * get default language attr value. * example getDefaultLangAttrVal(['title_en'=>'xx','title_fr'=>'yy'],'title'); */ - public function getDefaultLangAttrVal($attrVal,$attrName){ + protected function actionGetDefaultLangAttrVal($attrVal,$attrName){ $defaultLangAttrName = $this->getDefaultLangAttrName($attrName); if(isset($attrVal[$defaultLangAttrName]) && !empty($attrVal[$defaultLangAttrName])){ return $attrVal[$defaultLangAttrName]; @@ -65,7 +65,7 @@ class Fecshoplang extends Service * if attribute in default language value is empty, '' will be return. * example getLangAttrVal(['title_en'=>'xx','title_fr'=>'yy'],'title','fr'); */ - public function getLangAttrVal($attrVal,$attrName,$langCode){ + protected function actionGetLangAttrVal($attrVal,$attrName,$langCode){ $langAttrName = $this->getLangAttrName($attrName,$langCode); if(isset($attrVal[$langAttrName]) && !empty($attrVal[$langAttrName])){ return $attrVal[$langAttrName]; @@ -85,7 +85,7 @@ class Fecshoplang extends Service * @return String , like en ,fr ,es , if $language is not exist in $this->allLangCode * empty will be return. */ - public function getLangCodeByLanguage($language){ + protected function actionGetLangCodeByLanguage($language){ if(isset($this->allLangCode[$language])){ return $this->allLangCode[$language]; }else{ diff --git a/services/Order.php b/services/Order.php index 7fd7337da6d4a4b836556fb5caff32eb6372654e..d9a1facd7afe4cbc3897ff6348f96930e4b42e9a 100644 --- a/services/Order.php +++ b/services/Order.php @@ -26,7 +26,7 @@ class Order extends Service /** * get all order collection */ - public function getOrderList(){ + protected function actionGetOrderList(){ } @@ -34,14 +34,14 @@ class Order extends Service /** * get order list by customer account id. */ - public function getAccountOrderList(){ + protected function actionGetAccountOrderList(){ } /** * get order list by customer account id. */ - public function changeOrderStatus(){ + protected function actionChangeOrderStatus(){ } @@ -49,7 +49,7 @@ class Order extends Service /** * get order by Id. */ - public function getOrderById(){ + protected function actionGetOrderById(){ } diff --git a/services/Product.php b/services/Product.php index 63d0c519feca11b858533a4b757079f50baa5a40..1983eb8e03a3bb2130378eaa30a9119bc5f913c7 100644 --- a/services/Product.php +++ b/services/Product.php @@ -20,11 +20,11 @@ class Product extends Service { private $_productId; - public function setCurrentProductId($productId){ + protected function actionSetCurrentProductId($productId){ $this->_productId = $productId; } - public function getCurrentProductId(){ + protected function actionGetCurrentProductId(){ return $this->_productId; } diff --git a/services/Search.php b/services/Search.php index 4ae4e96af7348851e4cee007a1710d35c21e9164..030e6420aa6dcea6542feef51d22487571483b12 100644 --- a/services/Search.php +++ b/services/Search.php @@ -19,12 +19,12 @@ use fec\helpers\CSession; class Search extends Service { - public function getProductList($text,$filter){ + protected function actionGetProductList($text,$filter){ } - public function getHotSearchText(){ + protected function actionGetHotSearchText(){ } diff --git a/services/Store.php b/services/Store.php index 6ce321a28d1914e7e17a234fb254f5e68c746a3a..38d5a6ac7c946b097ac86909247d43153f9d6766 100644 --- a/services/Store.php +++ b/services/Store.php @@ -43,8 +43,6 @@ class Store extends Service * current store code , this property will init value with store code. */ public $currentStore; - - /** * current language code example : fr es cn ru. */ @@ -55,13 +53,9 @@ class Store extends Service * if current store_code is not config , InvalidValueException will be throw. * class property $currentStore will be set value $store_code. */ - public function actionBootstrap($app){ - - //Yii::$service = new \fecshop\services\Service; - //Yii::createObject($service); + protected function actionBootstrap($app){ $host = explode('://' ,$app->getHomeUrl()); $stores = $this->stores; - $init_compelte = 0; if(is_array($stores) && !empty($stores)){ foreach($stores as $store_code => $store){ @@ -97,7 +91,6 @@ class Store extends Service }else{ $currency = ''; } - Yii::$service->page->currency->initCurrency($currency); /** * current domian is config is store config. @@ -110,7 +103,6 @@ class Store extends Service if(!$init_compelte){ throw new InvalidValueException('this domain is not config in store component'); } - } /** @@ -164,7 +156,7 @@ class Store extends Service * if lang attribute in current store language is empty , default language attribute will be return. * if attribute in default language value is empty, $attrVal will be return. */ - public function getStoreAttrVal($attrVal,$attrName){ + protected function actionGetStoreAttrVal($attrVal,$attrName){ $lang = $this->currentLangCode; return Yii::$service->fecshoplang->getLangAttrVal($attrVal,$attrName,$lang); } @@ -173,7 +165,7 @@ class Store extends Service * @return Array * get all store info, one item in array format is: ['storeCode' => 'store language']. */ - public function getStoresLang(){ + protected function actionGetStoresLang(){ $stores = $this->stores; $topLang = []; foreach($stores as $storeCode=> $store){ diff --git a/services/Url.php b/services/Url.php index 97a292c3f22168e3c134c38c96a4aa2a87a56846..f0b705a7af72b550f6af3d135c3c873d76bc0888 100644 --- a/services/Url.php +++ b/services/Url.php @@ -136,7 +136,7 @@ class Url extends Service * Yii::$service->url->getUrlByPath('cms/article/index',['id'=>33]); * Yii::$service->url->getUrlByPath('cms/article/index',['id'=>33],true); */ - protected function getUrl($path,$params=[],$https=false){ + protected function actionGetUrl($path,$params=[],$https=false){ if($https){ $baseUrl = $this->getHttpsBaseUrl(); }else{ @@ -155,7 +155,7 @@ class Url extends Service /** * get current base url , is was generate by http(or https ).'://'.store_code */ - public function getCurrentBaseUrl(){ + protected function actionGetCurrentBaseUrl(){ if(!$this->_currentBaseUrl){ $homeUrl = $this->homeUrl(); if($this->showScriptName){ @@ -172,7 +172,7 @@ class Url extends Service /** * get current home url , is was generate by 'http://'.store_code */ - public function homeUrl(){ + protected function actionHomeUrl(){ return Yii::$app->getHomeUrl(); } diff --git a/services/category/Menu.php b/services/category/Menu.php index 3dd4d7f32826d6cba1fc20cae09457a6e51a9791..0ae0ef4df26f63fea256656e2666ca3d47c57635 100644 --- a/services/category/Menu.php +++ b/services/category/Menu.php @@ -26,7 +26,7 @@ class Menu extends Service * get category menu as array. array key is: _id ,name ,urlPath,childMenu * */ - public function getCategoryMenuArr($parentId=''){ + protected function actionGetCategoryMenuArr($parentId=''){ $arr = []; if(!$parentId) $parentId = $this->rootCategoryId; @@ -57,7 +57,7 @@ class Menu extends Service * @property $categoryId|Array * check if cateogry has child . */ - public function hasChild($categoryId){ + protected function hasChild($categoryId){ $one = Category::find()->asArray()->where([ 'parent_id' => $categoryId ])->one(); diff --git a/services/category/Product.php b/services/category/Product.php index e7f887acc1dc199be6967977a1d85095d4972e84..84339f77ebedcebed505146e3ad12e841af946a6 100644 --- a/services/category/Product.php +++ b/services/category/Product.php @@ -41,7 +41,7 @@ class Product extends Service ] */ - public function getFilterProduct($filter){ + protected function actionGetFilterProduct($filter){ $where = isset($filter['where']) ? $filter['where'] : ''; $categoryId = isset($filter['categoryId']) ? $filter['categoryId'] : ''; if($categoryId){ diff --git a/services/cms/Article.php b/services/cms/Article.php index eeb6fea83e710abe36fd7dbc922407aa73a5828a..8273fe9ce677995f7af86863d9c776ed02cb827f 100644 --- a/services/cms/Article.php +++ b/services/cms/Article.php @@ -25,7 +25,6 @@ class Article extends Service public $storage = 'mongodb'; protected $_article; - public function init(){ if($this->storage == 'mongodb'){ $this->_article = new ArticleMongodb; @@ -43,13 +42,13 @@ class Article extends Service /** * get artile's primary key. */ - public function getPrimaryKey(){ + protected function actionGetPrimaryKey(){ return $this->_article->getPrimaryKey(); } /** * get artile model by primary key. */ - public function getByPrimaryKey($primaryKey){ + protected function actionGetByPrimaryKey($primaryKey){ return $this->_article->getByPrimaryKey($primaryKey); } @@ -73,7 +72,7 @@ class Article extends Service * 'asArray' => true, * ] */ - public function coll($filter=''){ + protected function actionColl($filter=''){ return $this->_article->coll($filter); } @@ -82,11 +81,11 @@ class Article extends Service * @property $originUrlKey|String , article origin url key. * save $data to cms model,then,add url rewrite info to system service urlrewrite. */ - public function save($one,$originUrlKey){ + protected function actionSave($one,$originUrlKey){ return $this->_article->save($one,$originUrlKey); } - public function remove($ids){ + protected function actionRemove($ids){ return $this->_article->remove($ids); } diff --git a/services/helper/Log.php b/services/helper/Log.php index 526464dafb2fbc1e03fff1e13d5bb0c5829e8954..801065de8cf7d86de6bc93cdf57893eadb7f531c 100644 --- a/services/helper/Log.php +++ b/services/helper/Log.php @@ -22,12 +22,9 @@ use fecshop\models\mongodb\FecshopServiceLog; */ class Log extends Service { - + public $log_config; protected $_serviceContent; protected $_serviceUid; - - public $log_config; - protected $_isServiceLog; protected $_isServiceLogDbPrint; protected $_isServiceLogHtmlPrint; diff --git a/services/page/Asset.php b/services/page/Asset.php index 505d277f65b51d21438de9c115523675a11bac8e..c8b13e118d16127994ec0e2584eaf53443ff8373 100644 --- a/services/page/Asset.php +++ b/services/page/Asset.php @@ -18,14 +18,13 @@ use yii\web\AssetBundle; use yii\base\Object; use yii\helpers\ArrayHelper; use yii\helpers\Url; - /** * page asset services * @author Terry Zhao <2358269014@qq.com> * @since 1.0 extends AssetBundle */ -class Asset +class Asset extends Service { public $cssOptions; public $jsOptions; @@ -38,7 +37,7 @@ class Asset /** * 文件路径默认放到模板路径下面的assets里面 */ - public function register($view){ + protected function actionRegister($view){ $assetArr = []; $themeDir = Yii::$service->page->theme->getThemeDirArr(); if( is_array($themeDir) && !empty($themeDir)){ @@ -103,7 +102,7 @@ class Asset } - public function initOptions($options){ + protected function initOptions($options){ if(isset($options['position'])){ if($options['position'] == 'POS_HEAD'){ $options['position'] = \yii\web\View::POS_HEAD; diff --git a/services/page/Breadcrumbs.php b/services/page/Breadcrumbs.php index 948b2529d37b1621ca468d5c0c5044e97dd21308..cf79e672f8827b8dfd0a58a4246b70d75df109b1 100644 --- a/services/page/Breadcrumbs.php +++ b/services/page/Breadcrumbs.php @@ -25,15 +25,6 @@ class Breadcrumbs extends Service public $intervalSymbol = ' > '; protected $_items; - /** - * property $items|Array. add $items to $this->_items. - * $items format example. - * $items = ['name'=>'fashion handbag','url'=>'http://www.xxx.com']; - */ - public function addItems($items){ - $this->_items[] = $items; - } - public function init(){ if($this->homeName){ $items['name'] = $this->homeName; @@ -43,10 +34,21 @@ class Breadcrumbs extends Service } } + /** + * property $items|Array. add $items to $this->_items. + * $items format example. + * $items = ['name'=>'fashion handbag','url'=>'http://www.xxx.com']; + */ + protected function actionAddItems($items){ + $this->_items[] = $items; + } + + + /** * generate Breadcrumbs html ,before generate , you should use addItems function to add breadcrumbs items. */ - public function generateHtml(){ + protected function actionGenerateHtml(){ $arr = []; if($this->_items){ foreach($this->_items as $item){ diff --git a/services/page/Menu.php b/services/page/Menu.php index 7091c1ed2b7e1258cc3e648d1839c43c9136f657..ba955ddf448ac710a7a882fd0b2ecb58857a800b 100644 --- a/services/page/Menu.php +++ b/services/page/Menu.php @@ -55,7 +55,7 @@ class Menu extends Service ] ] */ - public function getMenuData(){ + protected function actionGetMenuData(){ $this->_homeUrl = CUrl::getHomeUrl(); $arr = []; if($displayHome = $this->displayHome){ diff --git a/services/page/Newsletter.php b/services/page/Newsletter.php index 4fca4f771571b00a89ac77929c0064f57ade5210..cb6bc2b47c4d6c192197434f7fb75b354deec991 100644 --- a/services/page/Newsletter.php +++ b/services/page/Newsletter.php @@ -25,7 +25,7 @@ class Newsletter extends Service /** * newsletter subscription */ - public function subscription($email){ + protected function actionSubscription($email){ $mongoNewsletter = new MongoNewsletter(); $mongoNewsletter->attributes = [ 'email' => $email, @@ -58,7 +58,7 @@ class Newsletter extends Service * @property $filter|array * get subscription email collection */ - public function getSubscriptionList($filter){ + protected function actionGetSubscriptionList($filter){ } diff --git a/services/page/Theme.php b/services/page/Theme.php index 0194a2e23b449eab86071f21b53fae0ef76ddd60..07465c894ec48c7fd3c6305473cf47e8dddbc533 100644 --- a/services/page/Theme.php +++ b/services/page/Theme.php @@ -45,7 +45,7 @@ class Theme extends Service protected $_themeDirArr; - public function getThemeDirArr(){ + protected function actionGetThemeDirArr(){ if(!$this->_themeDirArr){ $arr = []; if($localThemeDir = Yii::getAlias($this->localThemeDir)){ @@ -67,7 +67,7 @@ class Theme extends Service /** * find theme file by mutil theme ,if not find view file and $throwError=true, it will throw InvalidValueException. */ - public function getViewFile($view,$throwError=true){ + protected function actionGetViewFile($view,$throwError=true){ $view = trim($view); if(substr($view,0,1) == '@'){ return Yii::getAlias($view); diff --git a/services/page/Translate.php b/services/page/Translate.php index 3f1f11e846093d9ae6c61c382c36560421b3993d..5830507c73e9c23a7e9555643efb97a5599b9272 100644 --- a/services/page/Translate.php +++ b/services/page/Translate.php @@ -38,7 +38,7 @@ class Translate extends Service } } - public function setLanguage($language){ + protected function actionSetLanguage($language){ Yii::$app->language = $language; } diff --git a/services/page/Widget.php b/services/page/Widget.php index 390a731759caef6714e06570f7d99ce01b1372a6..1f5a892a35e58a526fadd0cd5b99f7cc73cb2a2b 100644 --- a/services/page/Widget.php +++ b/services/page/Widget.php @@ -43,7 +43,7 @@ class Widget extends Service ] ] */ - public function render($configKey,$parentThis=''){ + protected function actionRender($configKey,$parentThis=''){ $config = ''; if(is_array($configKey)){ $config = $configKey; @@ -59,33 +59,7 @@ class Widget extends Service return $this->renderContent($configKey,$config,$parentThis); } - - protected function renderContent($configKey,$config,$parentThis=''){ - if(isset($config['cache']['enable']) && $config['cache']['enable']){ - if(!isset($config['class']) || !$config['class']){ - throw new InvalidConfigException('in widget ['.$configKey.'],you enable cache ,you must config widget class .'); - }else if($ob = new $config['class']){ - if($ob instanceof BlockCache){ - $cacheKey = $ob->getCacheKey(); - if(!($content = CCache::get($cacheKey))){ - $cache = $config['cache']; - $timeout = isset($cache['timeout']) ? $cache['timeout'] : 0; - unset($config['cache']); - $content = $this->renderContentHtml($configKey,$config,$parentThis); - CCache::set($cacheKey,$content,$timeout); - } - return $content; - }else{ - throw new InvalidConfigException($config['class'].' must implete fecshop\interfaces\block\BlockCache when you use block cache .'); - } - } - } - $content = $this->renderContentHtml($configKey,$config,$parentThis); - return $content; - - } - - public function renderContentHtml($configKey,$config,$parentThis=''){ + protected function actionRenderContentHtml($configKey,$config,$parentThis=''){ if( !isset($config['view']) || empty($config['view']) ){ throw new InvalidConfigException('view and class must exist in array config!'); @@ -120,6 +94,34 @@ class Widget extends Service } + protected function renderContent($configKey,$config,$parentThis=''){ + if(isset($config['cache']['enable']) && $config['cache']['enable']){ + if(!isset($config['class']) || !$config['class']){ + throw new InvalidConfigException('in widget ['.$configKey.'],you enable cache ,you must config widget class .'); + }else if($ob = new $config['class']){ + if($ob instanceof BlockCache){ + $cacheKey = $ob->getCacheKey(); + if(!($content = CCache::get($cacheKey))){ + $cache = $config['cache']; + $timeout = isset($cache['timeout']) ? $cache['timeout'] : 0; + unset($config['cache']); + $content = $this->renderContentHtml($configKey,$config,$parentThis); + CCache::set($cacheKey,$content,$timeout); + } + return $content; + }else{ + throw new InvalidConfigException($config['class'].' must implete fecshop\interfaces\block\BlockCache when you use block cache .'); + } + } + } + $content = $this->renderContentHtml($configKey,$config,$parentThis); + return $content; + + } + + + + /** * find theme file by mutil theme ,if not find view file and $throwError=true, it will throw InvalidValueException. */ diff --git a/services/product/BestSell.php b/services/product/BestSell.php index 30fc9118c22d5e3b07e23a12c42936ebe7da927e..86c51eca0bc16153d58ca9c7af292e600ebff7d0 100644 --- a/services/product/BestSell.php +++ b/services/product/BestSell.php @@ -21,7 +21,7 @@ class BestSell extends Service * õȫƷIJƷ */ - public function getCategoryProduct() + protected function actionGetCategoryProduct() { return 'category best sell product'; } @@ -29,7 +29,7 @@ class BestSell extends Service /** * õȫƷIJƷ */ - public function getProduct(){ + protected function actionGetProduct(){ } diff --git a/services/product/Coll.php b/services/product/Coll.php index 1c761a38b5fe60416896209c9bdca59ccc65e585..50202400aae06dd60853718ee5097821ca0bb159 100644 --- a/services/product/Coll.php +++ b/services/product/Coll.php @@ -56,7 +56,7 @@ class Coll extends Service * 'asArray' => true, * ] */ - public function getProducts($filter){ + protected function actionGetProducts($filter){ $numPerPage = isset($filter['numPerPage']) ? $filter['numPerPage'] : $this->numPerPage; $pageNum = isset($filter['pageNum']) ? $filter['pageNum'] : $this->pageNum; $orderBy = isset($filter['orderBy']) ? $filter['orderBy'] : $this->orderBy; diff --git a/services/product/Image.php b/services/product/Image.php index a5375f637d985ac7598d529b1c92bffe51165e7a..312e63dd44917c9e046e0e3059fe764f5b5489d1 100644 --- a/services/product/Image.php +++ b/services/product/Image.php @@ -70,7 +70,7 @@ class Image extends Service * return , if success ,return image saved relative file path , like '/b/i/big.jpg' * if fail, reutrn false; */ - public function saveProductUploadImg($param_img_file){ + protected function actionSaveProductUploadImg($param_img_file){ $this->initUploadImage(); $size = $param_img_file['size']; $file = $param_img_file['tmp_name']; diff --git a/services/product/Info.php b/services/product/Info.php index 28c5143ad5fdf4120a640970aa2bbabecbb112a2..628e7b6e5ed8503772f0b27b16ee96fd81842754 100644 --- a/services/product/Info.php +++ b/services/product/Info.php @@ -30,7 +30,7 @@ class Info extends Service * image will return full image url * this function will be use for front product info page. */ - public function getProduct($productId='',$selectAttr=[]) + protected function actionGetProduct($productId='',$selectAttr=[]) { //echo 33;exit; if(!$this->_product){ @@ -59,7 +59,7 @@ class Info extends Service * @property $product is object. * convert product language attribute to current language value. */ - public function getCurrentLangProduct($product){ + protected function actionGetCurrentLangProduct($product){ $lang_attrs = $this->getLangAttr(); foreach($lang_attrs as $attr){ $product->$attr = Yii::$service->store->getLangVal($product->$attr,$attr); @@ -69,7 +69,7 @@ class Info extends Service /** * product language attributes array. */ - public function getLangAttr(){ + protected function actionGetLangAttr(){ return [ 'name', 'title', diff --git a/services/url/Rewrite.php b/services/url/Rewrite.php index bcf412416a06c31b28c005b4cc49464edf289cbe..1000fab83c391edac227f1368899d7a73fa5f701 100644 --- a/services/url/Rewrite.php +++ b/services/url/Rewrite.php @@ -34,20 +34,20 @@ class Rewrite extends Service } } - public function actionGetOriginUrl($urlKey){ + protected function actionGetOriginUrl($urlKey){ return $this->_urlRewrite->getOriginUrl($urlKey); } /** * get artile's primary key. */ - public function actionGetPrimaryKey(){ + protected function actionGetPrimaryKey(){ return $this->_urlRewrite->getPrimaryKey(); } /** * get artile model by primary key. */ - public function actionGetByPrimaryKey($primaryKey){ + protected function actionGetByPrimaryKey($primaryKey){ return $this->_urlRewrite->getByPrimaryKey($primaryKey); } @@ -73,7 +73,7 @@ class Rewrite extends Service * 'asArray' => true, * ] */ - public function actionColl($filter=''){ + protected function actionColl($filter=''){ return $this->_urlRewrite->coll($filter); } @@ -82,24 +82,24 @@ class Rewrite extends Service * @property $originUrlKey|String , article origin url key. * save $data to cms model,then,add url rewrite info to system service urlrewrite. */ - public function actionSave($one){ + protected function actionSave($one){ return $this->_urlRewrite->save($one); } - public function actionRemove($ids){ + protected function actionRemove($ids){ return $this->_urlRewrite->remove($ids); } - public function actionFind(){ + protected function actionFind(){ return $this->_urlRewrite->find(); } - public function actionFindOne($where){ + protected function actionFindOne($where){ return $this->_urlRewrite->findOne($where); } - public function actionNewModel(){ + protected function actionNewModel(){ return $this->_urlRewrite->newModel(); }