General clean up.

This commit is contained in:
James Cole 2014-11-12 22:21:48 +01:00
parent 44d189d7d3
commit 2e2c12d6a4
16 changed files with 562 additions and 495 deletions

View File

@ -51,13 +51,19 @@ class BudgetController extends BaseController
$limit->repeat_freq = 'monthly';
$limit->repeats = 0;
$limit->save();
Event::fire('limits.store', [$limit]);
/*
* A newly stored limit also created a limit repetition.
*/
Event::fire('limits.store', [$limit]); // Still in use.
} else {
if ($amount > 0) {
$limit->amount = $amount;
$limit->save();
Event::fire('limits.update', [$limit]);
/*
* An updated limit also updates the associated limit repetitions.
*/
Event::fire('limits.update', [$limit]); // Still in use.
} else {
$limit->delete();
}

View File

@ -264,7 +264,6 @@ class GoogleTableController extends BaseController
$date = $journal->date;
$descriptionURL = route('transactions.show', $journal->id);
$description = $journal->description;
$amount = floatval(-0.01); // TODO
$id = $journal->id;

View File

@ -60,8 +60,6 @@ class PiggybankController extends BaseController
*/
public function destroy(Piggybank $piggyBank)
{
Event::fire('piggybanks.destroy', [$piggyBank]);
/** @var \FireflyIII\Database\Piggybank $acct */
$repos = App::make('FireflyIII\Database\Piggybank');
$repos->destroy($piggyBank);

View File

@ -107,16 +107,6 @@ class EloquentPiggybankTrigger
return true;
}
/**
* @param \Piggybank $piggyBank
*
* @return bool
*/
public function destroy(\Piggybank $piggyBank)
{
return true;
}
/**
* @param \Piggybank $piggyBank
* @param $amount
@ -175,7 +165,6 @@ class EloquentPiggybankTrigger
*/
public function subscribe(Dispatcher $events)
{
$events->listen('piggybanks.destroy', 'Firefly\Trigger\Piggybanks\EloquentPiggybankTrigger@destroy');
$events->listen(
'piggybanks.modifyAmountAdd', 'Firefly\Trigger\Piggybanks\EloquentPiggybankTrigger@modifyAmountAdd'
);

View File

@ -6,6 +6,7 @@ use Carbon\Carbon;
use FireflyIII\Database\Ifaces\AccountInterface;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
@ -198,16 +199,6 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
return $this->getAccountsByType(['Expense account', 'Beneficiary account'], $parameters);
}
/**
* Get all default accounts.
*
* @return Collection
*/
public function getDefaultAccounts()
{
// TODO: Implement getDefaultAccounts() method.
}
/**
* Returns an object with id $id.
*
@ -237,16 +228,6 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
// TODO: Implement get() method.
}
/**
* Counts the number of total revenue accounts. Useful for DataTables.
*
@ -281,19 +262,6 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
die('No impl');
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
@ -462,6 +430,38 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
return false;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
return $this->getUser()->accounts()->whereIn('id', $ids)->get();
}
/**
* Get all default accounts.
*
* @return Collection
*/
public function getDefaultAccounts()
{
// TODO: Implement getDefaultAccounts() method.
throw new NotImplementedException;
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
// TODO: Implement get() method.
throw new NotImplementedException;
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
@ -472,15 +472,20 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
/**
* @param array $ids
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @return Collection
* @param Ardent $model
*
* @return array
*/
public function getByIds(array $ids)
public function validateObject(Ardent $model)
{
return $this->getUser()->accounts()->whereIn('id', $ids)->get();
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
}

View File

@ -3,6 +3,7 @@
namespace FireflyIII\Database;
use Firefly\Exception\FireflyException;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
use FireflyIII\Database\Ifaces\AccountTypeInterface;
@ -56,6 +57,7 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
throw new NotImplementedException;
}
/**
@ -69,6 +71,7 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
@ -82,6 +85,7 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function validate(array $model)
{
// TODO: Implement validate() method.
throw new NotImplementedException;
}
/**
@ -92,6 +96,19 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function store(array $data)
{
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
/**
@ -104,6 +121,7 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
@ -114,6 +132,7 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function get()
{
// TODO: Implement get() method.
throw new NotImplementedException;
}
/**
@ -124,16 +143,6 @@ class AccountType implements AccountTypeInterface, CUD, CommonDatabaseCalls
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
}

View File

@ -2,13 +2,13 @@
namespace FireflyIII\Database;
use Carbon\Carbon;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
use Illuminate\Support\Collection;
use FireflyIII\Database\Ifaces\BudgetInterface;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\BudgetInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
/**
* Class Budget
@ -54,18 +54,6 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
return true;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
}
/**
* Validates an array. Returns an array containing MessageBags
@ -130,18 +118,6 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
return $budget;
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
}
/**
* Returns all objects.
*
@ -169,27 +145,6 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
return $sum;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
}
/**
* @param Carbon $start
@ -234,4 +189,55 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
return true;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
}

View File

@ -2,13 +2,13 @@
namespace FireflyIII\Database;
use Carbon\Carbon;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
use Illuminate\Support\Collection;
use FireflyIII\Database\Ifaces\CategoryInterface;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\CategoryInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
/**
* Class Category
@ -38,18 +38,6 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
return true;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
}
/**
* Validates an array. Returns an array containing MessageBags
@ -94,28 +82,6 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
];
}
/**
* @param array $data
*
* @return Ardent
*/
public function store(array $data)
{
// TODO: Implement store() method.
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
}
/**
* Returns all objects.
*
@ -126,27 +92,6 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
return $this->getUser()->categories()->orderBy('name', 'ASC')->get();
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
}
/**
* @param \Category $budget
@ -193,4 +138,66 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
return true;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
* @param array $data
*
* @return Ardent
*/
public function store(array $data)
{
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
}

View File

@ -2,13 +2,13 @@
namespace FireflyIII\Database;
use Carbon\Carbon;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
use Illuminate\Support\Collection;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\PiggybankInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
/**
* Class Piggybank
@ -19,6 +19,14 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
{
use SwitchUser;
/**
*
*/
public function __construct()
{
$this->setUser(\Auth::user());
}
/**
* @param \Account $account
*
@ -36,14 +44,6 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
}
/**
*
*/
public function __construct()
{
$this->setUser(\Auth::user());
}
/**
* @param Ardent $model
*
@ -54,18 +54,6 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
$model->delete();
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
}
/**
* Validates an array. Returns an array containing MessageBags
@ -179,17 +167,6 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
$piggybank->save();
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
}
/**
* Returns all objects.
@ -201,28 +178,6 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
return $this->getUser()->piggybanks()->where('repeats', 0)->get();
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
}
/**
* @param Ardent $model
* @param array $data
@ -240,11 +195,62 @@ class Piggybank implements CUD, CommonDatabaseCalls, PiggybankInterface
$model->reminder_skip = isset($data['reminder_skip']) ? $data['reminder_skip'] : 0;
$model->order = isset($data['order']) ? $data['order'] : 0;
$model->remind_me = isset($data['remind_me']) ? intval($data['remind_me']) : 0;
if(!$model->validate()) {
if (!$model->validate()) {
var_dump($model->errors());
exit();
}
$model->save();
return true;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
}

View File

@ -4,6 +4,7 @@ namespace FireflyIII\Database;
use Carbon\Carbon;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
@ -40,6 +41,17 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
return $this->getUser()->recurringtransactions()->get();
}
/**
* @param Ardent $model
*
@ -48,6 +60,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
throw new NotImplementedException;
}
/**
@ -61,6 +74,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
@ -74,6 +88,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function validate(array $model)
{
// TODO: Implement validate() method.
throw new NotImplementedException;
}
/**
@ -84,6 +99,19 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function store(array $data)
{
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
/**
@ -96,16 +124,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function find($id)
{
// TODO: Implement find() method.
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
return $this->getUser()->recurringtransactions()->get();
throw new NotImplementedException;
}
/**
@ -116,6 +135,7 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
@ -128,16 +148,6 @@ class Recurring implements CUD, CommonDatabaseCalls, RecurringInterface
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
}

View File

@ -2,14 +2,12 @@
namespace FireflyIII\Database;
use Carbon\Carbon;
use FireflyIII\Database\Ifaces\RecurringTransactionInterface;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\RecurringTransactionInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
/**
* Class Account
@ -28,6 +26,17 @@ class RecurringTransaction implements CUD, CommonDatabaseCalls, RecurringTransac
$this->setUser(\Auth::user());
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
return $this->getUser()->recurringtransactions()->get();
}
/**
* @param Ardent $model
*
@ -103,16 +112,6 @@ class RecurringTransaction implements CUD, CommonDatabaseCalls, RecurringTransac
throw new NotImplementedException;
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
return $this->getUser()->recurringtransactions()->get();
}
/**
* @param array $ids
*

View File

@ -3,13 +3,14 @@
namespace FireflyIII\Database;
use Firefly\Exception\FireflyException;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\TransactionInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\TransactionInterface;
/**
* Class Transaction
*
@ -19,29 +20,6 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
{
use SwitchUser;
/**
* @param Ardent $model
*
* @return bool
*/
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
}
/**
* Validates an array. Returns an array containing MessageBags
* errors/warnings/successes.
@ -119,7 +97,6 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
*/
public function store(array $data)
{
// TODO: Implement store() method.
$transaction = new \Transaction;
$transaction->account()->associate($data['account']);
$transaction->transactionJournal()->associate($data['transaction_journal']);
@ -138,6 +115,43 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
return $transaction;
}
/**
* @param Ardent $model
*
* @return bool
*/
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
throw new NotImplementedException;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
/**
* Returns an object with id $id.
*
@ -148,6 +162,7 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
@ -158,6 +173,18 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
public function get()
{
// TODO: Implement get() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
@ -170,26 +197,6 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
}

View File

@ -3,6 +3,7 @@
namespace FireflyIII\Database;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
@ -17,6 +18,17 @@ use FireflyIII\Database\Ifaces\TransactionCurrencyInterface;
class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDatabaseCalls
{
/**
* @param string $code
*
* @return \TransactionCurrency|null
*/
public function findByCode($code)
{
return \TransactionCurrency::whereCode($code)->first();
}
/**
* @param Ardent $model
*
@ -25,6 +37,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
throw new NotImplementedException;
}
/**
@ -38,6 +51,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
@ -51,6 +65,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
public function validate(array $model)
{
// TODO: Implement validate() method.
throw new NotImplementedException;
}
/**
@ -61,6 +76,19 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
public function store(array $data)
{
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
/**
@ -73,6 +101,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
@ -83,6 +112,18 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
public function get()
{
// TODO: Implement get() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
@ -94,37 +135,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CUD, CommonDa
*/
public function findByWhat($what)
{
// TODO: Implement get() method.
}
/**
* @param string $code
*
* @return \TransactionCurrency|null
*/
public function findByCode($code)
{
return \TransactionCurrency::whereCode($code)->first();
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
}
/**
* @param Ardent $model
* @param array $data
*
* @return bool
*/
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
}

View File

@ -8,6 +8,7 @@ use Firefly\Exception\FireflyException;
use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\TransactionJournalInterface;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use LaravelBook\Ardent\Ardent;
@ -121,29 +122,6 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
}
/**
* @param Ardent $model
*
* @return bool
*/
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
}
/**
* Validates an array. Returns an array containing MessageBags
* errors/warnings/successes.
@ -452,25 +430,28 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
* @param Ardent $model
*
* @param $what
*
* @return \AccountType|null
* @return bool
*/
public function findByWhat($what)
public function destroy(Ardent $model)
{
// TODO: Implement findByWhat() method.
// TODO: Implement destroy() method.
throw new NotImplementedException;
}
/**
* @param array $ids
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @return Collection
* @param Ardent $model
*
* @return array
*/
public function getByIds(array $ids)
public function validateObject(Ardent $model)
{
// TODO: Implement getByIds() method.
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
@ -482,5 +463,30 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
*
* @return \AccountType|null
*/
public function findByWhat($what)
{
// TODO: Implement findByWhat() method.
throw new NotImplementedException;
}
}

View File

@ -7,6 +7,7 @@ use FireflyIII\Database\Ifaces\CommonDatabaseCalls;
use FireflyIII\Database\Ifaces\CUD;
use FireflyIII\Database\Ifaces\TransactionTypeInterface;
use FireflyIII\Exception\FireflyException;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use LaravelBook\Ardent\Ardent;
@ -18,74 +19,6 @@ use LaravelBook\Ardent\Ardent;
class TransactionType implements TransactionTypeInterface, CUD, CommonDatabaseCalls
{
/**
* @param Ardent $model
*
* @return bool
*/
public function destroy(Ardent $model)
{
// TODO: Implement destroy() method.
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
}
/**
* Validates an array. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param array $model
*
* @return array
*/
public function validate(array $model)
{
// TODO: Implement validate() method.
}
/**
* @param array $data
*
* @return Ardent
*/
public function store(array $data)
{
// TODO: Implement store() method.
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
// TODO: Implement get() method.
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
@ -115,13 +48,53 @@ class TransactionType implements TransactionTypeInterface, CUD, CommonDatabaseCa
}
/**
* @param array $ids
* @param Ardent $model
*
* @return Collection
* @return bool
*/
public function getByIds(array $ids)
public function destroy(Ardent $model)
{
// TODO: Implement getByIds() method.
// TODO: Implement destroy() method.
throw new NotImplementedException;
}
/**
* Validates a model. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param Ardent $model
*
* @return array
*/
public function validateObject(Ardent $model)
{
// TODO: Implement validateObject() method.
throw new NotImplementedException;
}
/**
* Validates an array. Returns an array containing MessageBags
* errors/warnings/successes.
*
* @param array $model
*
* @return array
*/
public function validate(array $model)
{
// TODO: Implement validate() method.
throw new NotImplementedException;
}
/**
* @param array $data
*
* @return Ardent
*/
public function store(array $data)
{
// TODO: Implement store() method.
throw new NotImplementedException;
}
/**
@ -133,5 +106,41 @@ class TransactionType implements TransactionTypeInterface, CUD, CommonDatabaseCa
public function update(Ardent $model, array $data)
{
// TODO: Implement update() method.
throw new NotImplementedException;
}
/**
* Returns an object with id $id.
*
* @param int $id
*
* @return Ardent
*/
public function find($id)
{
// TODO: Implement find() method.
throw new NotImplementedException;
}
/**
* Returns all objects.
*
* @return Collection
*/
public function get()
{
// TODO: Implement get() method.
throw new NotImplementedException;
}
/**
* @param array $ids
*
* @return Collection
*/
public function getByIds(array $ids)
{
// TODO: Implement getByIds() method.
throw new NotImplementedException;
}
}