public $verify_key; // int(11)
public $verified;
public $created_dt; // datetime(19) binary
+ public $company_name;
+ public $person_type;
+
+ public $person_id;
+ public $person_table;
// function verify($key)
// {
// }
// }
- function sendVerification()
+ function convertTo($target = false)
{
+ if(!$target){
+ return false;
+ }
+ $roo = HTML_FlexyFramework::get()->page;
+
+ if($target->get('email', $this->email)){
+ return $target;
+ }
+
+ $target->setFrom($this->toArray());
+
+ $target->insert();
+
+ $this->person_id = $target->id;
+ // ok - deleting might not be a great idea.... - as we can not track already confirmed codes..
+
+ //$this->delete();
+
+ return $target;
+ }
+
+ function sendVerification($template, $roo)
+ {
+
+ $content = array(
+ 'template' => $template,
+ 'person' => $this,
+ 'serverName' => $_SERVER['SERVER_NAME'],
+ 'baseURL' => $roo->baseURL
+ );
+
+ $sent = DB_DataObject::factory('core_email')->send($content);
+
+ if(!is_object($sent)){
+ return true;
+ }
+
+ return $sent;
+ }
+
+ function getEmailFrom()
+ {
+ if (empty($this->name)) {
+ return $this->email;
+ }
+ return '"' . addslashes($this->name) . '" <' . $this->email . '>';
}
}