mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-09-29 21:11:12 -04:00
* Clean up Client Show * Working on Show Client menu action * working on client view permissions * Finishing up Client Statement View * Workig on client settings * add mix manifest * css for client settings * Client Settings * Working on Client Settings * Implement StartupCheck and static seeders * Implement cached statics in view composers * Working on client settings * Payment Terms * Working on Payment Terms View Composer * Payment Terms builder * Client Settings * refactor companies table * Refactor for company settings, move settings to json * Set object cast on settings column of Company table * Fixes for refactor of companies and clients table * Test * Client Settings Datamapper * Client Settings * Default client language * Client Settings * Working on client settings options * Client Settings * Settings Json serialization/deserialization handling
28 lines
537 B
PHP
28 lines
537 B
PHP
<?php
|
|
|
|
namespace App\DataMapper;
|
|
|
|
/**
|
|
* ClientSettings
|
|
*/
|
|
class BaseSettings
|
|
{
|
|
/**
|
|
* Migrates properties of the datamapper classes when new properties are added
|
|
*
|
|
* @param \stdClass $object Datamapper settings object
|
|
* @return \stdClass $object Datamapper settings object updated
|
|
*/
|
|
public function migrate(\stdClass $object) : \stdClass
|
|
{
|
|
$properties = self::default();
|
|
|
|
foreach($properties as $property)
|
|
{
|
|
if(!property_exists($object, $property))
|
|
$object->{$property} = NULL;
|
|
}
|
|
|
|
return $object;
|
|
}
|
|
} |