Example #1
0
 public function update()
 {
     if (!isset($this->item->account_id)) {
         $account = Sp4kAppsAccountApp::getInstance(new Registry(['created' => time()]))->getItem()->update();
         $this->item->account_id = $account->id;
     }
     if ($this->item->juser_id == null || $this->item->juser_id == 0) {
         if (isset($this->item->email) && $this->item->email != '' && trim($this->item->f_name . ' ' . $this->item->l_name) != '' && !JUserHelper::getUserId($this->item->email)) {
             $this->item->juser_id = $this->addJoomlaUser(strtolower($this->item->email), $this->item->f_name . ' ' . $this->item->l_name, strtolower($this->item->email), JUserHelper::genRandomPassword());
         } else {
             $this->item->juser_id = 0;
         }
     }
     if ($this->state->get('children', false)) {
         foreach ($this->state->get('children') as $child) {
             $childAppItem = Sp4kAppsChildApp::getInstance(new Registry($child))->getItem();
             $childAppItem->account_id = $account->id;
             $childAppItem->update();
         }
     }
     $this->item->update();
 }
Example #2
0
 public function update()
 {
     $this->item->update();
 }