/** * Updates status, generates confirmation row * @return IdentityConfirmation */ public function startConfirmation($type = IdentityConfirmation::TYPE_ACTIVATION_EMAIL) { $identityConfirmation = new IdentityConfirmation(); $identityConfirmation->user_identity_id = $this->id; $identityConfirmation->sent_ts = date('Y-m-d H:i:s'); $identityConfirmation->type = $type; $identityConfirmation->key = md5($identityConfirmation->type . $this->identity . microtime()); $identityConfirmation->save(); return $identityConfirmation; }