2014-06-30 07:26:38 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace Firefly\Storage\Account;
|
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* Interface AccountRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package Firefly\Storage\Account
|
|
|
|
*/
|
2014-06-30 07:26:38 +02:00
|
|
|
interface AccountRepositoryInterface
|
|
|
|
{
|
2014-06-30 15:46:12 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-06-30 07:26:38 +02:00
|
|
|
public function count();
|
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
2014-07-26 18:53:41 +02:00
|
|
|
* @param $name
|
|
|
|
* @param \AccountType $type
|
|
|
|
*
|
2014-07-25 13:02:01 +02:00
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function createOrFind($name, \AccountType $type);
|
2014-07-15 06:58:08 +02:00
|
|
|
|
2014-09-11 21:58:51 +02:00
|
|
|
/**
|
|
|
|
* Gets a list of accounts that have the mentioned type. Will automatically convert
|
|
|
|
* strings in this array to actual (model) account types.
|
|
|
|
*
|
|
|
|
* @param array $types
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getOfTypes(array $types);
|
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
2014-07-26 18:53:41 +02:00
|
|
|
* @param $name
|
|
|
|
*
|
2014-07-25 13:02:01 +02:00
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function createOrFindBeneficiary($name);
|
|
|
|
|
|
|
|
/**
|
2014-08-02 07:49:48 +02:00
|
|
|
* @param \Account $account
|
2014-07-26 18:53:41 +02:00
|
|
|
*
|
2014-08-02 07:49:48 +02:00
|
|
|
* @return mixed
|
2014-07-26 18:53:41 +02:00
|
|
|
*/
|
2014-08-02 07:49:48 +02:00
|
|
|
public function destroy(\Account $account);
|
2014-07-15 06:58:08 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @param $accountId
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function find($accountId);
|
|
|
|
|
2014-09-02 08:58:56 +02:00
|
|
|
/**
|
|
|
|
* @param $type
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function findAccountType($type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $name
|
|
|
|
* @param \AccountType $type
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function findByName($name, \AccountType $type = null);
|
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @param $name
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-09-02 08:58:56 +02:00
|
|
|
public function findByNameAny($name);
|
2014-07-15 11:04:53 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function get();
|
2014-07-15 20:58:35 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function getActiveDefault();
|
2014-07-15 06:58:08 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function getActiveDefaultAsSelectList();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getBeneficiaries();
|
2014-07-15 06:58:08 +02:00
|
|
|
|
2014-07-26 08:05:02 +02:00
|
|
|
/**
|
2014-07-26 18:53:41 +02:00
|
|
|
* @param $ids
|
2014-07-26 08:05:02 +02:00
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-29 19:37:52 +02:00
|
|
|
public function getByIds(array $ids);
|
2014-07-26 08:05:02 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function getCashAccount();
|
2014-07-05 19:44:26 +02:00
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-26 18:53:41 +02:00
|
|
|
public function getDefault();
|
2014-07-15 06:58:08 +02:00
|
|
|
|
2014-09-03 07:11:35 +02:00
|
|
|
/**
|
|
|
|
* @param \AccountType $type
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getByAccountType(\AccountType $type);
|
|
|
|
|
2014-09-02 17:27:28 +02:00
|
|
|
/**
|
|
|
|
* @param \User $user
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function overruleUser(\User $user);
|
|
|
|
|
2014-07-25 13:02:01 +02:00
|
|
|
/**
|
|
|
|
* @param $data
|
|
|
|
*
|
2014-07-26 08:05:02 +02:00
|
|
|
* @return \Account
|
2014-07-25 13:02:01 +02:00
|
|
|
*/
|
2014-07-03 21:31:32 +02:00
|
|
|
public function store($data);
|
2014-07-15 06:58:08 +02:00
|
|
|
|
2014-07-26 08:05:02 +02:00
|
|
|
/**
|
2014-08-02 07:49:48 +02:00
|
|
|
* @param \Account $account
|
|
|
|
* @param $data
|
2014-07-26 08:05:02 +02:00
|
|
|
*
|
2014-08-02 07:49:48 +02:00
|
|
|
* @return mixed
|
2014-07-26 08:05:02 +02:00
|
|
|
*/
|
2014-08-02 07:49:48 +02:00
|
|
|
public function update(\Account $account, $data);
|
2014-07-26 08:05:02 +02:00
|
|
|
|
2014-06-30 07:26:38 +02:00
|
|
|
}
|