Example #1
0
 /**
  * Constructor
  *
  * @param boolean $exists   Whether the object exists in database or not.
  *                          If false a ID will be automatically choosen
  */
 public function __construct($exists = false)
 {
     parent::__construct($exists);
     if (!$exists) {
         $this->id = $this->getTable()->getFreeId();
     }
 }
Example #2
0
 /**
  * Constructor
  *
  * @param boolean $exists   Whether the object exists in database or not.
  *                          If false a ID will be automatically choosen
  */
 public function __construct($exists = false)
 {
     parent::__construct($exists);
     if ($exists == false) {
         $this->salt = sha1(uniqid(mt_rand(), true));
     }
 }
Example #3
0
 /**
  * Constructor
  *
  * @param boolean $exists   Whether the object exists in database or not.
  *                          If false a ID will be automatically choosen
  */
 public function __construct($exists = false)
 {
     parent::__construct($exists);
 }