original_string: public static function fieldsets()
  	{
  		$class = get_called_class();
  
  		if (array_key_exists($class, static::$_fieldsets_cached))
  		{
  			return static::$_fieldsets_cached[$class];
  		}
  
  		$fieldsets = [];
  
  		if (property_exists($class, '_fieldsets'))
  		{
  			$fieldsets = [];
  
  			foreach (static::$_fieldsets as $fieldset => $config)
  			{
  				if (is_int($fieldset))
  				{
  					$fieldset = $config;
  					$config = null;
  				}
  
  				if (empty($config))
  				{
  					$config = [
  						'legend' => $fieldset,
  					];
  				}
  				elseif (is_string($config))
  				{
  					$config = [
  						'legend' => $config,
  					];
  				}
  
  				$fieldsets[$fieldset] = $config;
  			}
  		}
  
  		return static::$_fieldsets_cached[$class] = $fieldsets;
  	}
code: public static function fieldsets()
  	{
  		$class = get_called_class();
  
  		if (array_key_exists($class, static::$_fieldsets_cached))
  		{
  			return static::$_fieldsets_cached[$class];
  		}
  
  		$fieldsets = [];
  
  		if (property_exists($class, '_fieldsets'))
  		{
  			$fieldsets = [];
  
  			foreach (static::$_fieldsets as $fieldset => $config)
  			{
  				if (is_int($fieldset))
  				{
  					$fieldset = $config;
  					$config = null;
  				}
  
  				if (empty($config))
  				{
  					$config = [
  						'legend' => $fieldset,
  					];
  				}
  				elseif (is_string($config))
  				{
  					$config = [
  						'legend' => $config,
  					];
  				}
  
  				$fieldsets[$fieldset] = $config;
  			}
  		}
  
  		return static::$_fieldsets_cached[$class] = $fieldsets;
  	}
code_tokens: public static function fieldsets ( ) { $ class = get_called_class ( ) ; if ( array_key_exists ( $ class , static :: $ _fieldsets_cached ) ) { return static :: $ _fieldsets_cached [ $ class ] ; } $ fieldsets = [ ] ; if ( property_exists ( $ class , '_fieldsets' ) ) { $ fieldsets = [ ] ; foreach ( static :: $ _fieldsets as $ fieldset => $ config ) { if ( is_int ( $ fieldset ) ) { $ fieldset = $ config ; $ config = null ; } if ( empty ( $ config ) ) { $ config = [ 'legend' => $ fieldset , ] ; } elseif ( is_string ( $ config ) ) { $ config = [ 'legend' => $ config , ] ; } $ fieldsets [ $ fieldset ] = $ config ; } } return static :: $ _fieldsets_cached [ $ class ] = $ fieldsets ; }
docstring: Returns the model fieldsets
  
  @return []
docstring_tokens: Returns the model fieldsets