Beispiel #1
0
 protected function _execute(CM_Params $params)
 {
     $code = $params->getString('code');
     $identityList = $params->getArray('identityList');
     $eventName = $params->getString('eventName');
     $propertyList = $params->getArray('propertyList');
     $kissMetrics = new CMService_KissMetrics_Client($code);
     $kissMetrics->setIdentityList($identityList);
     $kissMetrics->trackEvent($eventName, $propertyList);
 }
Beispiel #2
0
 protected function _execute(CM_Params $params)
 {
     $propertyId = $params->getString('propertyId');
     $parameterList = $params->getArray('parameterList');
     $client = new CMService_GoogleAnalytics_MeasurementProtocol_Client($propertyId);
     $client->_submitHit($parameterList);
 }
Beispiel #3
0
 protected function _execute(CM_Params $params)
 {
     $id = $params->getInt('id');
     $values = $params->getArray('values');
     $svm = new CM_SVM_Model($id);
     return $svm->predict($values);
 }
Beispiel #4
0
 protected function _execute(CM_Params $params)
 {
     $id = $params->getInt('id');
     $class = $params->getInt('class');
     $values = $params->getArray('values');
     $svm = new CM_SVM_Model($id);
     $svm->addTraining($class, $values);
 }
Beispiel #5
0
 public function ajax_validate(CM_Params $params, CM_Frontend_JavascriptContainer_View $handler, CM_Http_Response_View_Ajax $response)
 {
     $data = $params->getArray('data');
     $result = [];
     foreach ($data as $name => $userInput) {
         $field = $this->getField($name);
         $empty = $field->isEmpty($userInput);
         $value = null;
         $validationError = null;
         if (!$empty) {
             try {
                 $value = $field->validate($response->getEnvironment(), $userInput);
             } catch (CM_Exception_FormFieldValidation $e) {
                 $validationError = $e->getMessagePublic($response->getRender());
             }
         }
         $result[$name] = ['value' => $value, 'empty' => $empty, 'validationError' => $validationError];
     }
     return $result;
 }
Beispiel #6
0
 public function ajax_getSuggestions(CM_Params $params, CM_Frontend_JavascriptContainer_View $handler, CM_Http_Response_View_Ajax $response)
 {
     return $this->_getSuggestions($params->getString('term'), $params->getArray('options'), $response->getRender());
 }