Update find methods to return null

This commit is contained in:
James Cole
2018-02-16 15:19:19 +01:00
parent 28b00f6507
commit 33db99ffd3
16 changed files with 142 additions and 34 deletions

View File

@@ -116,7 +116,7 @@ class SetSourceAccount implements ActionInterface
{
$account = $this->repository->findByName($this->action->action_value, [AccountType::DEFAULT, AccountType::ASSET]);
if (null === $account->id) {
if (null === $account) {
Log::debug(sprintf('There is NO asset account called "%s".', $this->action->action_value));
return false;
@@ -133,7 +133,7 @@ class SetSourceAccount implements ActionInterface
private function findRevenueAccount()
{
$account = $this->repository->findByName($this->action->action_value, [AccountType::REVENUE]);
if (null === $account->id) {
if (null === $account) {
// create new revenue account with this name:
$data = [
'name' => $this->action->action_value,