mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 10:39:01 -04:00 
			
		
		
		
	* Datamapping JSON Settings * JSON Mapping * User Setting Defaults * Testing Json Mapper * Implemented User Settings - hydrated from JSON format
		
			
				
	
	
		
			40 lines
		
	
	
		
			710 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			710 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\DataMapper;
 | |
| 
 | |
| use App\Models\Client;
 | |
| 
 | |
| class DefaultSettings
 | |
| {
 | |
| 
 | |
| 	public static $per_page = 20;
 | |
| 
 | |
| 	public static function userSettings() : \stdClass
 | |
| 	{
 | |
| 		return (object)[
 | |
| 	        class_basename(Client::class) => self::clientSettings(),
 | |
| 	    ];
 | |
| 	}
 | |
| 
 | |
| 	private static function clientSettings() : \stdClass
 | |
| 	{
 | |
| 		
 | |
| 		return (object)[
 | |
| 			'datatable' => (object) [
 | |
| 				'per_page' => self::$per_page,
 | |
| 				'column_visibility' => (object)[
 | |
| 					'__checkbox' => true,
 | |
| 	    			'name' => true,
 | |
| 	    			'contact' => true,
 | |
| 	    			'email' => true,
 | |
| 	    			'client_created_at' => true,
 | |
| 	    			'last_login' => true,
 | |
| 	    			'balance' => true,
 | |
| 	    			'__component:client-actions' => true
 | |
| 				]
 | |
| 			]
 | |
| 		];
 | |
| 
 | |
| 	}
 | |
| 
 | |
| } |