Completato sistema di banner e rotazioni Inserito sistema per ricerca full text
44 lines
873 B
PHP
44 lines
873 B
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 13/gen/2016
|
|
*/
|
|
|
|
|
|
class UserModel extends Model{
|
|
public function __construct($saveableObject = null){
|
|
parent::__construct($saveableObject);
|
|
|
|
if (!$this->hasProperty("newsletter")){
|
|
$this->newsletter = true;
|
|
}
|
|
|
|
if (!$this->hasProperty("email")){
|
|
throw new CoreException("Impossible to create a user without a mail address");
|
|
}
|
|
|
|
if (!$this->hasProperty("username")){
|
|
throw new CoreException("Impossible to create a user without a username");
|
|
}
|
|
|
|
if(!$this->hasProperty("password")){
|
|
new CoreException("Impossible to create a user without a password");
|
|
}
|
|
|
|
if(!$this->hasProperty("active")){
|
|
$this->active = false;
|
|
}
|
|
|
|
if(!$this->hasProperty("activationSent")){
|
|
$this->activationSent = false;
|
|
}
|
|
}
|
|
|
|
public static function getCollectionName(){
|
|
return "users";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
?>
|