Fixed some bugs

This commit is contained in:
James Cole
2014-11-14 19:33:50 +01:00
parent de20563275
commit 7b7743c03e
5 changed files with 67 additions and 7 deletions

View File

@@ -170,6 +170,11 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
throw new NotImplementedException;
}
public function firstOrCreate($name)
{
return \Category::firstOrCreate(['user_id' => $this->getUser()->id, 'name' => $name]);
}
public function getTransactionJournals(\Category $category, $limit = 50)
{
$offset = intval(\Input::get('page')) > 0 ? intval(\Input::get('page')) * $limit : 0;