X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_person_signup.php;h=8280401a37e579195779cef7bdba447c953bdbcb;hb=71b79ff7af09995cf797ff973f8004c0d3dc8f0f;hp=cb996cd1528b461358b9456e3fa53fdf5f71a3f2;hpb=c3e589eae949b6c98574345bdf85d9dc0a5133bb;p=Pman.Core diff --git a/DataObjects/Core_person_signup.php b/DataObjects/Core_person_signup.php index cb996cd1..8280401a 100644 --- a/DataObjects/Core_person_signup.php +++ b/DataObjects/Core_person_signup.php @@ -28,8 +28,7 @@ class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject public $person_id; public $person_table; - public $invite_id; - public $friend_table; + public $inviter_id; function convertTo($target = false) { @@ -41,12 +40,7 @@ class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject $old = clone($this); // this shold not really happen... if($target->get('email', $this->email)){ - - $this->person_id = $target->id; - $this->person_table = $target->tableName(); - $this->update($old); - - return $target; + return false; } $target->setFrom($this->toArray()); @@ -57,14 +51,8 @@ class Pman_Core_DataObjects_Core_person_signup extends DB_DataObject $this->person_table = $target->tableName(); $this->update($old); - if(!empty($this->invite_id) && !empty($this->friend_table)){ - $friend = DB_DataObject::factory($this->friend_table); - $friend->setFrom(array( - 'person_id' => $this->invite_id, - 'friend_id' => $target->id - )); - - $friend->insert(); + if(!empty($this->inviter_id) && method_exists($target, 'createFriend')){ + $target->createFriend($this->inviter_id); } return $target;