function run_job()
 {
     $es = new entity_selector($this->site_id);
     $es->add_type(id_of('news'));
     $result = $es->run_one();
     if ($result) {
         $ids = array_keys($result);
         foreach ($result as $id => $item) {
             reason_expunge_entity($id, $this->user_id);
         }
     }
     $es = new entity_selector($this->site_id);
     $es->add_type(id_of('publication_type'));
     $result = $es->run_one();
     if ($result) {
         $ids = array_keys($result);
         foreach ($result as $id => $item) {
             reason_expunge_entity($id, $this->user_id);
         }
     }
     $es = new entity_selector($this->site_id);
     $es->add_type(id_of('category_type'));
     $result = $es->run_one();
     if ($result) {
         $ids = array_keys($result);
         foreach ($result as $id => $item) {
             reason_expunge_entity($id, $this->user_id);
         }
     }
     $es = new entity_selector($this->site_id);
     $es->add_type(id_of('comment_type'));
     $result = $es->run_one();
     if ($result) {
         $ids = array_keys($result);
         foreach ($result as $id => $item) {
             reason_expunge_entity($id, $this->user_id);
         }
     }
     $es = new entity_selector($this->site_id);
     $es->add_type(id_of('minisite_page'));
     $result = $es->run_one();
     if ($result) {
         $root_page = root_finder($this->site_id);
         $ids = array_keys($result);
         foreach ($result as $id => $item) {
             if ($id != $root_page) {
                 reason_expunge_entity($id, $this->user_id);
             }
         }
     }
     $this->set_report('Zapped all the news, publications, categories, comments, and pages from the site');
 }
Exemplo n.º 2
0
 function get_site_root($site_id)
 {
     if (!isset($this->site_root[$site_id])) {
         $this->site_root[$site_id] = root_finder($site_id);
     }
     return $this->site_root[$site_id];
 }
 /**
  * If the destination site lacks a root node - there is no need to remove the relationship.
  */
 private function new_site_has_root_node()
 {
     reason_include_once('function_libraries/root_finder.php');
     $root = root_finder($this->config('new_site_id'));
     return !empty($root);
 }