original_string: protected function setDataCategoriesEditCategory()
      {
          $category_id = $this->getData('category.category_id');
  
          if (isset($category_id)) {
  
              $category_group_id = $this->getData('category_group.category_group_id');
  
              $options = array(
                  'parent_id' => $category_id,
                  'category_group_id' => $category_group_id
              );
  
              $children = $this->category->getTree($options);
  
              $exclude = array($category_id);
              foreach ($children as $child) {
                  $exclude[] = $child['category_id'];
              }
  
              $categories = $this->getData('categories');
              $modified = array_diff_key($categories, array_flip($exclude));
              $this->setData('categories', $modified);
          }
      }
code: protected function setDataCategoriesEditCategory()
      {
          $category_id = $this->getData('category.category_id');
  
          if (isset($category_id)) {
  
              $category_group_id = $this->getData('category_group.category_group_id');
  
              $options = array(
                  'parent_id' => $category_id,
                  'category_group_id' => $category_group_id
              );
  
              $children = $this->category->getTree($options);
  
              $exclude = array($category_id);
              foreach ($children as $child) {
                  $exclude[] = $child['category_id'];
              }
  
              $categories = $this->getData('categories');
              $modified = array_diff_key($categories, array_flip($exclude));
              $this->setData('categories', $modified);
          }
      }
code_tokens: protected function setDataCategoriesEditCategory ( ) { $ category_id = $ this -> getData ( 'category.category_id' ) ; if ( isset ( $ category_id ) ) { $ category_group_id = $ this -> getData ( 'category_group.category_group_id' ) ; $ options = array ( 'parent_id' => $ category_id , 'category_group_id' => $ category_group_id ) ; $ children = $ this -> category -> getTree ( $ options ) ; $ exclude = array ( $ category_id ) ; foreach ( $ children as $ child ) { $ exclude [ ] = $ child [ 'category_id' ] ; } $ categories = $ this -> getData ( 'categories' ) ; $ modified = array_diff_key ( $ categories , array_flip ( $ exclude ) ) ; $ this -> setData ( 'categories' , $ modified ) ; } }
docstring: Adds list of categories on the edit category page
docstring_tokens: Adds list of categories on the edit category page