firefly-iii/app/lib/FireflyIII/Database/Ifaces/AccountInterface.php

109 lines
2.3 KiB
PHP
Raw Normal View History

<?php
2014-10-30 13:26:28 -05:00
namespace FireflyIII\Database\Ifaces;
use Illuminate\Support\Collection;
/**
* Interface AccountInterface
*
* @package FireflyIII\Database
*/
interface AccountInterface
{
/**
2014-11-12 15:37:09 -06:00
* Counts the number of accounts found with the included types.
*
2014-11-12 15:37:09 -06:00
* @param array $types
*
2014-11-12 15:37:09 -06:00
* @return int
*/
2014-11-12 15:37:09 -06:00
public function countAccountsByType(array $types);
/**
* Counts the number of total asset accounts. Useful for DataTables.
*
* @return int
*/
public function countAssetAccounts();
/**
* Counts the number of total expense accounts. Useful for DataTables.
*
* @return int
*/
public function countExpenseAccounts();
/**
* Counts the number of total revenue accounts. Useful for DataTables.
*
* @return int
*/
public function countRevenueAccounts();
/**
* @param array $parameters
*
* @return Collection
*/
/**
* @param \Account $account
*
* @return \Account|null
*/
public function findInitialBalanceAccount(\Account $account);
/**
2014-11-12 15:37:09 -06:00
* Get all accounts of the selected types. Is also capable of handling DataTables' parameters.
*
2014-11-12 15:37:09 -06:00
* @param array $types
* @param array $parameters
*
* @return Collection
*/
2014-11-12 15:37:09 -06:00
public function getAccountsByType(array $types, array $parameters = []);
/**
2014-11-12 15:37:09 -06:00
* Get all asset accounts. The parameters are optional and are provided by the DataTables plugin.
*
* @param array $parameters
*
* @return Collection
*/
2014-11-12 15:37:09 -06:00
public function getAssetAccounts(array $parameters = []);
/**
2014-11-12 15:37:09 -06:00
* Get all default accounts.
*
2014-11-12 15:37:09 -06:00
* @return Collection
*/
2014-11-12 15:37:09 -06:00
public function getDefaultAccounts();
public function getExpenseAccounts(array $parameters = []);
/**
2014-11-12 15:37:09 -06:00
* Get all revenue accounts.
*
* @param array $parameters
*
* @return Collection
*/
2014-11-12 15:37:09 -06:00
public function getRevenueAccounts(array $parameters = []);
/**
* @param \Account $account
*
* @return \TransactionJournal|null
*/
public function openingBalanceTransaction(\Account $account);
/**
* @param \Account $account
2014-11-12 15:37:09 -06:00
* @param array $data
*
* @return bool
*/
public function storeInitialBalance(\Account $account, array $data);
}