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

@@ -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;
}
}