firefly-iii/app/Repositories/Journal/JournalRepositoryInterface.php

110 lines
2.4 KiB
PHP
Raw Normal View History

2015-02-09 00:23:39 -06:00
<?php
namespace FireflyIII\Repositories\Journal;
use Carbon\Carbon;
use FireflyIII\Models\Transaction;
2015-04-07 11:26:14 -05:00
use FireflyIII\Models\TransactionJournal;
2015-04-11 12:59:41 -05:00
use FireflyIII\Models\TransactionType;
use Illuminate\Pagination\LengthAwarePaginator;
2015-02-25 14:19:06 -06:00
use Illuminate\Support\Collection;
2015-02-09 00:23:39 -06:00
2015-02-11 00:35:10 -06:00
/**
* Interface JournalRepositoryInterface
*
* @package FireflyIII\Repositories\Journal
*/
interface JournalRepositoryInterface
{
2015-04-11 12:59:41 -05:00
/**
2015-05-05 00:28:04 -05:00
* @param TransactionJournal $journal
2015-04-11 12:59:41 -05:00
*
2015-05-05 00:28:04 -05:00
* @return bool
2015-04-11 12:59:41 -05:00
*/
2015-05-05 00:28:04 -05:00
public function delete(TransactionJournal $journal);
2015-04-11 12:59:41 -05:00
/**
2015-05-05 00:28:04 -05:00
* Get users first transaction journal
*
* @return TransactionJournal
*/
2015-05-05 00:28:04 -05:00
public function first();
/**
* @param TransactionJournal $journal
* @param Transaction $transaction
*
* @return float
*/
public function getAmountBefore(TransactionJournal $journal, Transaction $transaction);
2015-04-28 03:36:13 -05:00
/**
2015-04-28 10:10:52 -05:00
* @param TransactionType $dbType
2015-04-28 03:36:13 -05:00
*
2015-04-28 10:10:52 -05:00
* @return Collection
2015-04-28 03:36:13 -05:00
*/
2015-04-28 10:10:52 -05:00
public function getJournalsOfType(TransactionType $dbType);
2015-04-28 03:36:13 -05:00
/**
* @param array $types
* @param int $offset
* @param int $page
*
* @return LengthAwarePaginator
*/
public function getJournalsOfTypes(array $types, $offset, $page);
2015-04-28 03:36:13 -05:00
/**
2015-04-28 10:10:52 -05:00
* @param $type
2015-04-28 03:36:13 -05:00
*
2015-04-28 10:10:52 -05:00
* @return TransactionType
2015-04-28 03:36:13 -05:00
*/
2015-04-28 10:10:52 -05:00
public function getTransactionType($type);
2015-04-28 03:36:13 -05:00
2015-05-05 00:28:04 -05:00
/**
2015-07-06 15:23:34 -05:00
* @param int $journalId
2015-05-05 00:28:04 -05:00
* @param Carbon $date
*
* @return TransactionJournal
*/
2015-07-06 15:23:34 -05:00
public function getWithDate($journalId, Carbon $date);
2015-05-05 00:28:04 -05:00
2015-04-11 12:59:41 -05:00
/**
2015-04-28 10:10:52 -05:00
* @param TransactionJournal $journal
* @param array $array
2015-04-11 12:59:41 -05:00
*
2015-04-28 10:10:52 -05:00
* @return void
2015-04-11 12:59:41 -05:00
/**
*
2015-04-28 10:10:52 -05:00
* @param TransactionJournal $journal
* @param array $array
*
* @return void
2015-04-11 12:59:41 -05:00
*/
2015-04-28 10:10:52 -05:00
public function saveTags(TransactionJournal $journal, array $array);
2015-02-24 15:53:38 -06:00
/**
* @param array $data
*
* @return TransactionJournal
*/
public function store(array $data);
2015-02-09 00:23:39 -06:00
2015-02-25 14:19:06 -06:00
/**
* @param TransactionJournal $journal
2015-02-27 07:27:04 -06:00
* @param array $data
2015-02-25 14:19:06 -06:00
*
2015-02-27 07:27:04 -06:00
* @return mixed
2015-02-25 14:19:06 -06:00
*/
2015-02-27 07:27:04 -06:00
public function update(TransactionJournal $journal, array $data);
2015-04-28 10:10:52 -05:00
/**
* @param TransactionJournal $journal
* @param array $array
*
* @return mixed
*/
public function updateTags(TransactionJournal $journal, array $array);
2015-03-29 01:14:32 -05:00
}