- Added new model "SubscriberList"

- Added has_many_through relations to the new model + Subscriber model
- Added tests
- Fixed syntax in other models
This closes #95
This commit is contained in:
MrCasual
2015-09-01 09:18:00 -04:00
parent e0ef01d9f8
commit 0015bdb617
9 changed files with 239 additions and 11 deletions

View File

@@ -20,11 +20,11 @@ class Setting extends Model {
}
public static function createOrUpdate($model) {
$exists = Setting::where('name', $model['name'])
$exists = self::where('name', $model['name'])
->find_one();
if($exists === false) {
$new_model = Setting::create();
$new_model = self::create();
$new_model->hydrate($model);
return $new_model->save();
}