1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 09:04:35 +01:00
invoiceninja/app/Repositories/GroupSettingRepository.php

33 lines
849 B
PHP
Raw Normal View History

2019-10-05 00:58:51 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
2019-10-05 00:58:51 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2019-10-05 00:58:51 +02:00
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Repositories;
use App\Models\GroupSetting;
2020-06-24 01:39:49 +02:00
class GroupSettingRepository extends BaseRepository
2019-10-05 00:58:51 +02:00
{
public function save($data, GroupSetting $group_setting) :?GroupSetting
{
$group_setting->fill($data);
$group_setting->save();
2019-10-05 00:58:51 +02:00
if (array_key_exists('company_logo', $data) && $data['company_logo'] == '') {
$settings = $group_setting->settings;
unset($settings->company_logo);
$group_setting->settings = $settings;
$group_setting->save();
}
return $group_setting;
}
}