2014-10-27 23:58:48 -05:00
|
|
|
<?php
|
|
|
|
|
2014-10-30 13:26:28 -05:00
|
|
|
namespace FireflyIII\Database\Ifaces;
|
2014-10-27 23:58:48 -05:00
|
|
|
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
use LaravelBook\Ardent\Ardent;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface CommonDatabaseCalls
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Database
|
|
|
|
*/
|
|
|
|
interface CommonDatabaseCalls
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns an object with id $id.
|
|
|
|
*
|
|
|
|
* @param int $id
|
|
|
|
*
|
|
|
|
* @return Ardent
|
|
|
|
*/
|
|
|
|
public function find($id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns all objects.
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function get();
|
|
|
|
|
2014-10-29 04:30:52 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $ids
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getByIds(array $ids);
|
|
|
|
|
2014-10-27 23:58:48 -05:00
|
|
|
/**
|
|
|
|
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
|
|
|
|
*
|
|
|
|
* @param $what
|
|
|
|
*
|
|
|
|
* @return \AccountType|null
|
|
|
|
*/
|
|
|
|
public function findByWhat($what);
|
|
|
|
|
|
|
|
}
|