protected function execute() { if ($this->state->get('paging', false)) { $limit = $this->state->get('limit'); $filters = $this->state->get('filters'); $count = $this->state->get('count', false); $appState = new Joomla\Registry\Registry(['limit' => $limit, 'count' => $count, 'filters' => $filters]); /** @var Sp4kAppsRegistrationApp $registrationApp */ $registrationApp = Sp4kAppsRegistrationApp::getInstance($appState); $appCollection = $registrationApp->getCollection(); $this->count = $appCollection->count; $this->items = $appCollection->items; foreach ($this->items as $item) { $item->child_name = Sp4kAppsChildApp::getInstance(new Registry(['id' => $item->child_id]))->getItem()->name; $item->product_name = Sp4kAppsProductApp::getInstance(new Registry(['id' => $item->product_id, 'plugins' => false]))->getItem()->title; } } else { $this->items = Sp4kAppsRegistrationApp::getInstance(new Joomla\Registry\Registry($this->state->toObject()))->getItems(); } }
public function execute() { $app = new Sp4kAppsAccountApp(new Registry($this->state->toObject())); $this->item = $app->getItem(); $this->id = $this->item->id; $this->created = $this->item->created; $accountFilter = ['filters' => ['account_id' => $this->id]]; if ($this->item->id != null) { $this->item->parents = Sp4kAppsParentApp::getInstance(new Registry($accountFilter))->getItems(); foreach ($this->item->parents as &$parent) { $juser = JFactory::getuser($parent->juser_id); $parent->name = $juser->name; $parent->email = $juser->email; } $this->item->children = Sp4kAppsChildApp::getInstance(new Registry($accountFilter))->getItems(); foreach ($this->item->children as $child) { $this->item->registrations = $this->item->registrations + Sp4kAppsRegistrationApp::getInstance(new Registry(['filters' => ['child_id' => $child->id]]))->getItems(); } $this->item->subscriptions = Sp4kAppsSubscriptionApp::getInstance(new Registry($accountFilter))->getItems(); $this->item->orders = Sp4kAppsOrderApp::getInstance(new Registry($accountFilter))->getItems(); } }
public function execute() { $this->item = Sp4kAppsRegistrationApp::getInstance(new Joomla\Registry\Registry($this->state->toObject()))->getItem(); }