added jsonserializable interface / trait
This commit is contained in:
		
							
								
								
									
										14
									
								
								core/General/JsonSerializeTrait.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								core/General/JsonSerializeTrait.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace ManiaControl\General;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class DumpTrait Trait for Implementing the Methods for the JsonSerializeable Interface
 | 
			
		||||
 *
 | 
			
		||||
 * @package ManiaControl\General
 | 
			
		||||
 */
 | 
			
		||||
trait JsonSerializeTrait {
 | 
			
		||||
	public function toJson(){
 | 
			
		||||
		return json_encode(get_object_vars($this));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user