src/PrestashopWebService.php
public function fillSchema(
        SimpleXMLElement $xmlSchema,
        $data,
        $removeUselessNodes = true,
        $removeSpecificNodes = array()
    ) {
        $resource = $xmlSchema->children()->children();
        foreach ($data as $key => $value) {
            $this->processNode($resource, $key, $value);
        }
        if ($removeUselessNodes) {
            $this->checkForUselessNodes($resource, $data);
        } else {
            $this->removeSpecificNodes($resource, $removeSpecificNodes);
        }
        return $xmlSchema;
    }
public function fillSchema(
        SimpleXMLElement $xmlSchema,
        $data,
        $removeUselessNodes = true,
        $removeSpecificNodes = array()
    ) {
        $resource = $xmlSchema->children()->children();
        foreach ($data as $key => $value) {
            $this->processNode($resource, $key, $value);
        }
        if ($removeUselessNodes) {
            $this->checkForUselessNodes($resource, $data);
        } else {
            $this->removeSpecificNodes($resource, $removeSpecificNodes);
        }
        return $xmlSchema;
    }
public function fillSchema ( SimpleXMLElement $ xmlSchema , $ data , $ removeUselessNodes = true , $ removeSpecificNodes = array ( ) ) { $ resource = $ xmlSchema -> children ( ) -> children ( ) ; foreach ( $ data as $ key => $ value ) { $ this -> processNode ( $ resource , $ key , $ value ) ; } if ( $ removeUselessNodes ) { $ this -> checkForUselessNodes ( $ resource , $ data ) ; } else { $ this -> removeSpecificNodes ( $ resource , $ removeSpecificNodes ) ; } return $ xmlSchema ; }
Fill the provided schema with an associative array data, also remove the useless XML nodes if
the corresponding flag is true

@param SimpleXMLElement $xmlSchema
@param array $data
@param bool $removeUselessNodes set true if you want to remove nodes that are not present in the data array
@param array $removeSpecificNodes If $removeUselessNodes is false you may add here the first level nodes that
you want to remove
@return SimpleXMLElement
Fill the provided schema with an associative array data also remove the useless XML nodes if the corresponding flag is true