/** * 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(); } }
/** * 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)); } }
/** * 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); }