original_string: public function add(array $data)
      {
          $result = null;
          $this->hook->attach('category.group.add.before', $data, $result, $this);
  
          if (isset($result)) {
              return (int) $result;
          }
  
          $result = $data['category_group_id'] = $this->db->insert('category_group', $data);
  
          $this->setTranslations($data, $this->translation_entity, 'category_group', false);
  
          $this->hook->attach('category.group.add.after', $data, $result, $this);
          return (int) $result;
      }
code: public function add(array $data)
      {
          $result = null;
          $this->hook->attach('category.group.add.before', $data, $result, $this);
  
          if (isset($result)) {
              return (int) $result;
          }
  
          $result = $data['category_group_id'] = $this->db->insert('category_group', $data);
  
          $this->setTranslations($data, $this->translation_entity, 'category_group', false);
  
          $this->hook->attach('category.group.add.after', $data, $result, $this);
          return (int) $result;
      }
code_tokens: public function add ( array $ data ) { $ result = null ; $ this -> hook -> attach ( 'category.group.add.before' , $ data , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( int ) $ result ; } $ result = $ data [ 'category_group_id' ] = $ this -> db -> insert ( 'category_group' , $ data ) ; $ this -> setTranslations ( $ data , $ this -> translation_entity , 'category_group' , false ) ; $ this -> hook -> attach ( 'category.group.add.after' , $ data , $ result , $ this ) ; return ( int ) $ result ; }
docstring: Adds a category group
  @param array $data
  @return integer
docstring_tokens: Adds a category group