projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ffa572a
)
DataObjects/Core_person_signup.php
author
Edward
<edward@roojs.com>
Wed, 25 Feb 2015 04:23:45 +0000
(12:23 +0800)
committer
Edward
<edward@roojs.com>
Wed, 25 Feb 2015 04:23:45 +0000
(12:23 +0800)
DataObjects/Core_person_signup.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_person_signup.php
b/DataObjects/Core_person_signup.php
index
594edda
..
3c86c39
100644
(file)
--- a/
DataObjects/Core_person_signup.php
+++ b/
DataObjects/Core_person_signup.php
@@
-95,23
+95,33
@@
class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject
// }
// }
// }
// }
- function
verified(
)
+ function
convertTo($target = false
)
{
{
- $hydra_person = DB_DataObject::factory('hydra_person');
+ if(!$target){
+ return false;
+ }
+
+ $roo = HTML_FlexyFramework::get()->page;
+
+ if($target->get('email', $this->email)){
+ return $target;
+ }
+
+ $target->setFrom($this->toArray());
- if(
$hydra_person->get('email', $this->email
)){
-
return $hydra_person
;
+ if(
method_exists($target, 'beforeInsert'
)){
+
$target->beforeInsert(array(), $roo)
;
}
}
- $hydra_person->setFrom($this->toArray());
- $hydra_person->employer_name = $this->company_name;
+ $target->insert();
- $hydra_person->beforeInsert(array(), $this);
- $hydra_person->insert();
+ if(method_exists($target, 'onInsert')){
+ $target->onInsert(array(), $roo);
+ }
$this->delete();
$this->delete();
- return $
hydra_person
;
+ return $
target
;
}
function sendVerification($template, $roo)
}
function sendVerification($template, $roo)