original_string: static public function tree( $args )
      {
          $returnArray = array(
              'status' => 'success',
              'message' => '',
              'children' => array()
          );
  
          $tagID = 0;
          if ( isset( $args[0] ) && is_numeric( $args[0] ) )
          {
              $tagID = (int)$args[0];
          }
  
          $children = eZTagsObject::fetchList(
              array(
                  'parent_id' => $tagID,
                  'main_tag_id' => 0
              )
          );
  
          if ( empty( $children ) )
          {
              return $returnArray;
          }
  
          foreach ( $children as $child )
          {
              $returnArray['children'][] = array(
                  'id' => (int) $child->attribute( 'id' ),
                  'parent' => (int) $child->attribute( 'parent_id' ),
                  'text' => $child->attribute( 'keyword' ),
                  'icon' => eZTagsTemplateFunctions::getTagIcon( $child->getIcon() ),
                  'children' => $child->getChildrenCount() > 0 ? true : false,
                  'state' => array(
                      'opened' => false,
                      'selected' => false
                  ),
                  'a_attr' => array(
                      'data-id' => (int) $child->attribute( 'id' ),
                      'data-name' => $child->attribute( 'keyword' ),
                      'data-parent_id' => (int) $child->attribute( 'parent_id' ),
                      'data-locale' => $child->attribute( 'current_language' )
                  )
              );
          }
  
          return $returnArray;
      }
code: static public function tree( $args )
      {
          $returnArray = array(
              'status' => 'success',
              'message' => '',
              'children' => array()
          );
  
          $tagID = 0;
          if ( isset( $args[0] ) && is_numeric( $args[0] ) )
          {
              $tagID = (int)$args[0];
          }
  
          $children = eZTagsObject::fetchList(
              array(
                  'parent_id' => $tagID,
                  'main_tag_id' => 0
              )
          );
  
          if ( empty( $children ) )
          {
              return $returnArray;
          }
  
          foreach ( $children as $child )
          {
              $returnArray['children'][] = array(
                  'id' => (int) $child->attribute( 'id' ),
                  'parent' => (int) $child->attribute( 'parent_id' ),
                  'text' => $child->attribute( 'keyword' ),
                  'icon' => eZTagsTemplateFunctions::getTagIcon( $child->getIcon() ),
                  'children' => $child->getChildrenCount() > 0 ? true : false,
                  'state' => array(
                      'opened' => false,
                      'selected' => false
                  ),
                  'a_attr' => array(
                      'data-id' => (int) $child->attribute( 'id' ),
                      'data-name' => $child->attribute( 'keyword' ),
                      'data-parent_id' => (int) $child->attribute( 'parent_id' ),
                      'data-locale' => $child->attribute( 'current_language' )
                  )
              );
          }
  
          return $returnArray;
      }
code_tokens: static public function tree ( $ args ) { $ returnArray = array ( 'status' => 'success' , 'message' => '' , 'children' => array ( ) ) ; $ tagID = 0 ; if ( isset ( $ args [ 0 ] ) && is_numeric ( $ args [ 0 ] ) ) { $ tagID = ( int ) $ args [ 0 ] ; } $ children = eZTagsObject :: fetchList ( array ( 'parent_id' => $ tagID , 'main_tag_id' => 0 ) ) ; if ( empty ( $ children ) ) { return $ returnArray ; } foreach ( $ children as $ child ) { $ returnArray [ 'children' ] [ ] = array ( 'id' => ( int ) $ child -> attribute ( 'id' ) , 'parent' => ( int ) $ child -> attribute ( 'parent_id' ) , 'text' => $ child -> attribute ( 'keyword' ) , 'icon' => eZTagsTemplateFunctions :: getTagIcon ( $ child -> getIcon ( ) ) , 'children' => $ child -> getChildrenCount ( ) > 0 ? true : false , 'state' => array ( 'opened' => false , 'selected' => false ) , 'a_attr' => array ( 'data-id' => ( int ) $ child -> attribute ( 'id' ) , 'data-name' => $ child -> attribute ( 'keyword' ) , 'data-parent_id' => ( int ) $ child -> attribute ( 'parent_id' ) , 'data-locale' => $ child -> attribute ( 'current_language' ) ) ) ; } return $ returnArray ; }
docstring: Returns children tags formatted for tree view plugin
  
  @static
  
  @param array $args
  
  @return array
docstring_tokens: Returns children tags formatted for tree view plugin