예제 #1
0
파일: WX.php 프로젝트: liuxuezhan/my_tool
 public function store($data, $is_validate = true)
 {
     $config = $this->getServiceLocator()->get('config');
     if ($this->validate($data)) {
         $ret = parent::store($data);
         if ($this->platform == self::ePlatform_Weixin || $this->platform == self::ePlatform_QQ) {
             $this->setAppId($config['platform'][$this->platform]['appid']);
             $this->setAppKey($config['platform'][$this->platform]['appkey']);
         } elseif ($this->platform == self::ePlatform_Guest) {
             //appid/openid need to add G_ prefix when in guest mode
             $this->setAppId($config['platform'][$this->platform]['prefix'] . $config['platform'][self::ePlatform_Weixin]['appid']);
             $this->setAppKey($config['platform'][self::ePlatform_Weixin]['appkey']);
         } else {
             //QQHall,WTLogin is not supported now
             $this->validationErrors[] = 'This platform is not supported now';
             $ret = $this->validationErrors;
         }
     } else {
         $ret = $this->validationErrors;
     }
     return $ret;
 }