Start of some remodelling.

This commit is contained in:
James Cole 2016-10-08 14:54:32 +02:00
parent 24f62b8fce
commit 6e90c033b1
3 changed files with 48 additions and 25 deletions

View File

@ -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
* *

View 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
{
}

View 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
{
}