mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-24 08:00:12 -06:00
Start of some remodelling.
This commit is contained in:
parent
24f62b8fce
commit
6e90c033b1
@ -121,31 +121,6 @@ class Account extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $fields
|
|
||||||
*
|
|
||||||
* @return Account|null
|
|
||||||
*/
|
|
||||||
public static function firstOrNullEncrypted(array $fields)
|
|
||||||
{
|
|
||||||
// everything but the name:
|
|
||||||
$query = Account::orderBy('id');
|
|
||||||
$search = $fields;
|
|
||||||
unset($search['name']);
|
|
||||||
foreach ($search as $name => $value) {
|
|
||||||
$query->where($name, $value);
|
|
||||||
}
|
|
||||||
$set = $query->get(['accounts.*']);
|
|
||||||
/** @var Account $account */
|
|
||||||
foreach ($set as $account) {
|
|
||||||
if ($account->name == $fields['name']) {
|
|
||||||
return $account;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Account $value
|
* @param Account $value
|
||||||
*
|
*
|
||||||
|
24
app/Repositories/Account/AccountTasker.php
Normal file
24
app/Repositories/Account/AccountTasker.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AccountTasker.php
|
||||||
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||||
|
*
|
||||||
|
* This software may be modified and distributed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||||
|
*
|
||||||
|
* See the LICENSE file for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Repositories\Account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AccountTasker
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Repositories\Account
|
||||||
|
*/
|
||||||
|
class AccountTasker
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
24
app/Repositories/Account/AccountTaskerInterface.php
Normal file
24
app/Repositories/Account/AccountTaskerInterface.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AccountTaskerInterface.php
|
||||||
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||||
|
*
|
||||||
|
* This software may be modified and distributed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||||
|
*
|
||||||
|
* See the LICENSE file for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Repositories\Account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface AccountTaskerInterface
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Repositories\Account
|
||||||
|
*/
|
||||||
|
interface AccountTaskerInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user