1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Repositories/CreditRepository.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2020-01-03 10:34:10 +01:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
2020-01-03 10:34:10 +01:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
2020-01-03 10:34:10 +01:00
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Repositories;
use App\Factory\CreditInvitationFactory;
use App\Models\ClientContact;
2020-10-28 11:10:49 +01:00
use App\Models\Company;
2020-01-03 10:34:10 +01:00
use App\Models\Credit;
use App\Models\CreditInvitation;
use App\Utils\Traits\MakesHash;
2020-01-03 10:34:10 +01:00
use Illuminate\Http\Request;
/**
* CreditRepository.
2020-01-03 10:34:10 +01:00
*/
class CreditRepository extends BaseRepository
{
use MakesHash;
2020-01-03 10:34:10 +01:00
public function __construct()
{
}
/**
* Saves the client and its contacts.
2020-01-03 10:34:10 +01:00
*
2020-10-28 11:10:49 +01:00
* @param array $data The data
* @param Credit $credit
* @return Credit|Credit|null Credit Object
* @throws \ReflectionException
2020-01-03 10:34:10 +01:00
*/
public function save(array $data, Credit $credit) : ?Credit
2020-01-03 10:34:10 +01:00
{
return $this->alternativeSave($data, $credit);
}
public function getInvitationByKey($key) :?CreditInvitation
{
return CreditInvitation::whereRaw('BINARY `key`= ?', [$key])->first();
2020-01-03 10:34:10 +01:00
}
}