Code cleanup.

This commit is contained in:
James Cole
2014-11-17 07:33:18 +01:00
parent 82c9a75578
commit 314abbea8b
39 changed files with 593 additions and 558 deletions

View File

@@ -46,15 +46,16 @@ class Category implements CUD, CommonDatabaseCalls, CategoryInterface
*/
public function store(array $data)
{
$category = new \Category;
$category->name = $data['name'];
$category = new \Category;
$category->name = $data['name'];
$category->class = 'Category';
$category->user()->associate($this->getUser());
if(!$category->validate()) {
if (!$category->validate()) {
var_dump($category->errors());
exit();
}
$category->save();
return $category;
}