Segments & Subscribers endpoints

- unit tests
This commit is contained in:
Jonathan Labreuille
2016-08-18 15:27:24 +02:00
parent d93249f077
commit afbe25e215
8 changed files with 226 additions and 165 deletions

View File

@ -23,12 +23,13 @@ class Subscriber extends Model {
));
}
static function findOne($id = null) {
static function findOne($id = false) {
if(is_int($id) || (string)(int)$id === $id) {
return parent::findOne($id);
} else {
} else if(strlen(trim($id)) > 0) {
return parent::where('email', $id)->findOne();
}
return false;
}
function segments() {