Files
firefly-iii/app/Crud/Account/AccountCrudInterface.php

85 lines
1.7 KiB
PHP
Raw Normal View History

2016-05-20 09:25:17 +02:00
<?php
/**
* AccountCrudInterface.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
declare(strict_types = 1);
2016-05-20 09:25:17 +02:00
namespace FireflyIII\Crud\Account;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountMeta;
2016-05-20 11:02:07 +02:00
use Illuminate\Support\Collection;
2016-05-20 09:25:17 +02:00
/**
* Interface AccountCrudInterface
*
* @package FireflyIII\Crud\Account
*/
interface AccountCrudInterface
{
/**
* @param Account $account
* @param Account $moveTo
*
* @return bool
*/
public function destroy(Account $account, Account $moveTo): bool;
/**
2016-05-20 09:45:24 +02:00
* @param int $accountId
2016-05-20 09:25:17 +02:00
*
2016-05-20 09:45:24 +02:00
* @return Account
2016-05-20 09:25:17 +02:00
*/
2016-05-20 09:45:24 +02:00
public function find(int $accountId): Account;
2016-05-20 09:25:17 +02:00
2016-07-15 22:37:47 +02:00
/**
* @param string $iban
*
* @return Account
*/
public function findByIban(string $iban): Account;
2016-05-20 11:02:07 +02:00
/**
* @param array $accountIds
*
* @return Collection
*/
public function getAccountsById(array $accountIds): Collection;
/**
* @param array $types
*
* @return Collection
*/
public function getAccountsByType(array $types): Collection;
2016-05-20 09:25:17 +02:00
/**
* @param array $data
*
* @return Account
*/
public function store(array $data) : Account;
/**
* @param $account
* @param $name
* @param $value
*
* @return AccountMeta
*/
public function storeMeta(Account $account, string $name, $value): AccountMeta;
/**
* @param Account $account
* @param array $data
*
* @return Account
*/
public function update(Account $account, array $data): Account;
}