function Celebros_Salesperson_Model_Api_QwiserSpellerInformation($xml_SpellerInformation)
 {
     if (is_object($xml_SpellerInformation)) {
         $this->SpellingErrorDetected = $xml_SpellerInformation->get_attribute("SpellingErrorDetected");
         $this->SpellerAutoCorrection = $xml_SpellerInformation->get_attribute("SpellerAutoCorrection");
         $this->AdditionalSuggestions = GetQwiserSimpleStringCollection(current(getDomElements($xml_SpellerInformation->child_nodes())));
     }
 }
 function Celebros_Conversionpro_Model_Api_QwiserSearchPathEntry($EntryNode)
 {
     if (is_object($EntryNode)) {
         $this->AnswerIndex = $EntryNode->get_attribute("AnswerIndex");
         $this->QuestionId = $EntryNode->get_attribute("QuestionID");
         $this->Answers = Mage::getModel('conversionpro/Api_QwiserAnswers', current(getDomElements($EntryNode->child_nodes())));
     }
 }
 function Celebros_Conversionpro_Model_Api_QwiserSearchPath($xml_SearchPath)
 {
     if (is_object($xml_SearchPath)) {
         $xml_SearchPathNodes = $xml_SearchPath->child_nodes();
         $xml_SearchPathNodes = getDomElements($xml_SearchPathNodes);
         $this->Count = count($xml_SearchPathNodes);
         for ($i = 0; $i < $this->Count; $i++) {
             $SearchPathNode = $xml_SearchPathNodes[$i];
             $this->Items[$i] = Mage::getModel('conversionpro/Api_QwiserSearchPathEntry', $SearchPathNode);
         }
     }
 }
 function Celebros_Salesperson_Model_Api_QwiserProductAnswers($xml_ProductAnswers)
 {
     if (is_object($xml_ProductAnswers)) {
         $xml_ProductAnswersNodes = $xml_ProductAnswers->child_nodes();
         $xml_ProductAnswersNodes = getDomElements($xml_ProductAnswersNodes);
         $this->Count = count($xml_ProductAnswersNodes);
         for ($i = 0; $i <= $this->Count - 1; $i++) {
             $ProductAnswerNode = $xml_ProductAnswersNodes[$i];
             $this->Items[$i] = Mage::getModel('salesperson/Api_QwiserProductAnswer', $ProductAnswerNode);
         }
     }
 }
 function Celebros_Salesperson_Model_Api_QwiserConcepts($xml_Concepts)
 {
     if (is_object($xml_Concepts)) {
         $xml_ConceptsNodes = $xml_Concepts->child_nodes();
         $xml_ConceptsNodes = getDomElements($xml_ConceptsNodes);
         $this->Count = count($xml_ConceptsNodes);
         for ($i = 0; $i <= $this->Count - 1; $i++) {
             $ConceptNode = $xml_ConceptsNodes[$i];
             $this->Items[$i] = Mage::getModel('salesperson/Api_QwiserConcept', $ConceptNode);
         }
     }
 }
 function Celebros_Conversionpro_Model_Api_QwiserProductFields($xml_ProductFields)
 {
     if (is_object($xml_ProductFields)) {
         $xml_ProductFieldsNodes = $xml_ProductFields->child_nodes();
         $xml_ProductFieldsNodes = getDomElements($xml_ProductFieldsNodes);
         $this->Count = count($xml_ProductFieldsNodes);
         for ($i = 0; $i <= $this->Count - 1; $i++) {
             $ProductFieldNode = $xml_ProductFieldsNodes[$i];
             $this->Items[$i] = Mage::getModel('conversionpro/Api_QwiserProductField', $ProductFieldNode);
         }
     }
 }
 function Celebros_Conversionpro_Model_Api_SpecialCasesDetectedInThisSession($xml_SpecialCasesDetectedInThisSession)
 {
     if (is_object($xml_SpecialCasesDetectedInThisSession)) {
         $xml_valuesNodes = $xml_SpecialCasesDetectedInThisSession->child_nodes();
         $xml_valuesNodes = getDomElements($xml_valuesNodes);
         $this->Count = count($xml_valuesNodes);
         for ($i = 0; $i <= $this->Count - 1; $i++) {
             $ValueNode = $xml_valuesNodes[$i];
             $this->Items[$i] = $ValueNode->node_value();
         }
     }
 }
 function Celebros_Conversionpro_Model_Api_QwiserProductAnswers($xml_ProductAnswers)
 {
     if (is_object($xml_ProductAnswers)) {
         $xml_ProductAnswersNodes = $xml_ProductAnswers->child_nodes();
         $xml_ProductAnswersNodes = getDomElements($xml_ProductAnswersNodes);
         $this->Count = count($xml_ProductAnswersNodes);
         for ($i = 0; $i <= $this->Count - 1; $i++) {
             $ProductAnswerNode = $xml_ProductAnswersNodes[$i];
             $key = $ProductAnswerNode->{$AnsweredAnswerNode}->get_attribute("Id");
             $this->Items[$key] = Mage::getModel('conversionpro/Api_QwiserProductAnswer', $ProductAnswerNode);
         }
     }
 }
示例#9
0
 function GetProductCommonInformation($ProdNode)
 {
     $ProductFields = current(getDomElements($ProdNode->child_nodes()));
     $ProductFieldsArray = getDomElements($ProductFields->child_nodes());
     foreach ($ProductFieldsArray as $Pfield) {
         /**
          * Make Fields keys lowercase
          * 
          * @modifyed by Sveta Oksen - sveta.oksen@gmail.com
          * @since 28/03/2011
          */
         $ProdField[strtolower($Pfield->get_attribute("name"))] = $Pfield->get_attribute("value");
     }
     return $ProdField;
 }
 function Celebros_Salesperson_Model_Api_QwiserQuestions($xml_Questions)
 {
     if (is_array($xml_Questions)) {
         $this->Items = $xml_Questions;
         $this->Count = count($xml_Questions);
     } else {
         if (is_object($xml_Questions)) {
             $xml_questionsNodes = $xml_Questions->child_nodes();
             $xml_questionsNodes = getDomElements($xml_questionsNodes);
             $this->Count = count($xml_questionsNodes);
             for ($i = 0; $i <= $this->Count - 1; $i++) {
                 $QuestionNode = $xml_questionsNodes[$i];
                 $this->Items[$i] = Mage::getModel('salesperson/Api_QwiserQuestion', $QuestionNode);
             }
         }
     }
 }
 function Celebros_Salesperson_Model_Api_QwiserAnswers($xml_Answers)
 {
     //if we got an array of QwiserAnswer
     if (is_array($xml_Answers)) {
         $this->Items = $xml_Answers;
         $this->Count = count($xml_Answers);
     } else {
         if (is_object($xml_Answers)) {
             $xml_AnswersNodes = $xml_Answers->child_nodes();
             $xml_AnswersNodes = getDomElements($xml_AnswersNodes);
             $this->Count = count($xml_AnswersNodes);
             for ($i = 0; $i <= $this->Count - 1; $i++) {
                 $AnswerNode = $xml_AnswersNodes[$i];
                 $this->Items[$i] = Mage::getModel('salesperson/Api_QwiserAnswer', $AnswerNode);
             }
         }
     }
 }
示例#12
0
 function Celebros_Conversionpro_Model_Api_QwiserQuestions($xml_Questions)
 {
     if (is_array($xml_Questions)) {
         $this->Items = $xml_Questions;
         $this->Count = count($xml_Questions);
     } else {
         if (is_object($xml_Questions)) {
             $xml_questionsNodes = $xml_Questions->child_nodes();
             $xml_questionsNodes = getDomElements($xml_questionsNodes);
             $this->Count = count($xml_questionsNodes);
             for ($i = 0; $i <= $this->Count - 1; $i++) {
                 $QuestionNode = $xml_questionsNodes[$i];
                 $key = $QuestionNode->get_attribute("Id");
                 $this->Items[$key] = Mage::getModel('conversionpro/Api_QwiserQuestion', $QuestionNode);
             }
         }
     }
 }
 function Celebros_Conversionpro_Model_Api_QwiserAnsweredAnswers($xml_AnsweredAnswers)
 {
     //if we got an array of QwiserAnswer
     if (is_array($xml_AnsweredAnswers)) {
         $this->Items = $xml_AnsweredAnswers;
         $this->Count = count($xml_AnsweredAnswers);
     } else {
         if (is_object($xml_AnsweredAnswers)) {
             $xml_AnsweredAnswersNodes = $xml_AnsweredAnswers->child_nodes();
             $xml_AnsweredAnswersNodes = getDomElements($xml_AnsweredAnswersNodes);
             $this->Count = count($xml_AnsweredAnswersNodes);
             for ($i = 0; $i <= $this->Count - 1; $i++) {
                 $AnsweredAnswerNode = $xml_AnsweredAnswersNodes[$i];
                 $key = $AnsweredAnswerNode->get_attribute("AnswerID");
                 $this->Items[$key] = Mage::getModel('conversionpro/Api_QwiserAnsweredAnswer', $AnsweredAnswerNode);
             }
         }
     }
 }
示例#14
0
 function Celebros_Conversionpro_Model_Api_QwiserQuestion($QuestionNode)
 {
     if (is_object($QuestionNode)) {
         $this->Id = $QuestionNode->get_attribute("Id");
         $this->Rank = $QuestionNode->get_attribute("Rank");
         $this->SideText = $QuestionNode->get_attribute("SideText");
         $this->Text = $QuestionNode->get_attribute("Text");
         $this->Type = $QuestionNode->get_attribute("Type");
         $this->Answers = Mage::getModel('conversionpro/Api_QwiserAnswers', current($QuestionNode->get_elements_by_tagname("Answers")));
         $this->ExtraAnswers = Mage::getModel('conversionpro/Api_QwiserAnswers', current($QuestionNode->get_elements_by_tagname("ExtraAnswers")));
         $this->HasMoreAnswers = $this->ExtraAnswers->Count > 0 ? true : false;
         //Question dynamic properties
         $QuestionDynamicProperties = null;
         $childNodes = $QuestionNode->child_nodes();
         $childNodes = getDomElements($childNodes);
         for ($i = 0; $i <= count($childNodes) - 1; $i++) {
             $childNode = $childNodes[$i];
             if ($childNode->node_name() == "DynamicProperties") {
                 $QuestionDynamicProperties = $childNode;
             }
         }
         $this->DynamicProperties = GetQwiserSimpleStringDictionary($QuestionDynamicProperties);
     }
 }
function GetQwiserSimpleStringDictionary($xml_node)
{
    $xml_nodes = $xml_node->child_nodes();
    $xml_nodes = getDomElements($xml_nodes);
    $arr = array();
    foreach ($xml_nodes as $node) {
        $arr[$node->get_attribute("name")] = $node->get_attribute("value");
    }
    return $arr;
}