mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
General clean up.
This commit is contained in:
@@ -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.
|
||||
@@ -52,9 +30,9 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
|
||||
*/
|
||||
public function validate(array $model)
|
||||
{
|
||||
$warnings = new MessageBag;
|
||||
$warnings = new MessageBag;
|
||||
$successes = new MessageBag;
|
||||
$errors = new MessageBag;
|
||||
$errors = new MessageBag;
|
||||
|
||||
|
||||
if (!isset($model['account_id']) && !isset($model['account'])) {
|
||||
@@ -106,8 +84,8 @@ class Transaction implements TransactionInterface, CUD, CommonDatabaseCalls
|
||||
}
|
||||
|
||||
return [
|
||||
'errors' => $errors,
|
||||
'warnings' => $warnings,
|
||||
'errors' => $errors,
|
||||
'warnings' => $warnings,
|
||||
'successes' => $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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user