Lots of code cleanup.

This commit is contained in:
James Cole
2014-11-15 07:46:01 +01:00
parent 3e02b50ea1
commit 6832f2ebd0
23 changed files with 245 additions and 819 deletions

View File

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