/** * Esta funcion es llamada en el for de la funcion anterior para cada categoria y recibe la etiqueta de la que es hijo * ($catxml) y la id de la categoria para que pueda sacar los productos de la categoria adecuada * @param type $catxml * @param type $idcateg */ function IncluyeArticulos($catxml, $idcateg) { $ProXCat = $this->Modelo_tv->ProductosCategoria($idcateg); $xmlarticulos = $catxml->addChild('articulos'); foreach ($ProXCat as $articulo) { $xmlarticulo = $xmlarticulos->addChild('articulo'); foreach ($articulo as $clave => $valor) { $xmlarticulo->addChild($clave, utf8_encode($valor)); } } }
/** * AÑADE LOS PRODUCTOS AL XML * @param type $xml_cat * @param type $idCat */ protected function XMLAddProductos($xml_cat, $idCat) { $productos = $this->productos->ProductosDeCat($idCat); //COGE LOS PRODUCTOS DE UNA CATEGORÍA $xml_productos = $xml_cat->addChild('productos'); //COGE LOS PRODUCTOS foreach ($productos as $pro) { //POR CADA PRODUCTO $xml_pro = $xml_productos->addChild('producto'); //COGE EL HIJO (PRODUCTO) foreach ($pro as $key => $valor) { //POR CADA VALOR DE UN PRODUCTO $xml_pro->addChild($key, utf8_encode($valor)); //AÑADE LOS HIJOS Y EL VALOR } } }
/** * Site identifier are different of one es identifier. * @param type $order * @param type $salesOrderRest */ protected function addXmlOrderIdentificator($order, $salesOrderRest) { $order->addChild("Ид", $salesOrderRest['fromsite']); }
/** * Add WALK (multiple oids) oids to XML node 'WALK' * * @param type $p_sxml_node * @param type $p_object * @param type $p_oid * @param type $p_link * @param type $p_vlan */ function addWalk($p_sxml_node, $p_object, $p_oid, $p_link, $p_vlan) { $sxml_walk = $p_sxml_node->addChild('WALK'); $sxml_walk->addAttribute('OBJECT', $p_object); $sxml_walk->addAttribute('OID', $p_oid); $sxml_walk->addAttribute('VLAN', $p_vlan); $sxml_walk->addAttribute('LINK', $p_link); }
/** * Adds owner of the catalog to thr document. * @param type $document */ private function addXmlOwner($document) { $organizationRest = $this->getOwnerRest(); $xmlOwner = $document->addChild("Владелец"); $xmlOwner->addChild("Ид", $organizationRest['inn']); $xmlOwner->addChild("Наименование", $organizationRest['organizationname']); $xmlOwner->addChild("ПолноеНаименование", $organizationRest['organizationname']); }