/** * @param mixed * false - disable sync * number - only pid * null - full */ protected function _update_tree($pid = null) { // rebuild tree $this->context->update_tree($this->get_site_id(), false); // sync parent `c_count` if (!empty($pid)) { $this->collection->sync_children_count($this->get_site_id(), $pid); } }
function run($file) { if (empty($file) || !file_exists($file)) { throw new tf_exception('Empty file'); } $response = file_get_contents($file); $xmldoc = new SimpleXMLElement($response); $this->module = core::module('sat'); $this->collection = $this->module->get_node_handle(); $this->collection->remove_all_fast(); foreach ($xmldoc->node as $node) { $this->import_node($node); } $this->collection->sync_children_count(); }