public function update() { if ($this->item) { $this->item->update(); } elseif ($this->collection) { $this->collection->update(); } else { $this->_error = "Unable to update; no data loaded."; } }
protected function bind() { parent::bind(); if ($this->plugins !== false) { $this->plugins = new stdClass(); foreach ($this->config as $index => $configopt) { $cartPluginClassName = 'Sp4kAppsProduct' . ucfirst($index) . 'Plg'; if (class_exists($cartPluginClassName)) { $state = new Registry(['options' => $configopt]); $this->plugins->{$index} = $cartPluginClassName::getInstance($this, $state); } } } }
protected function load() { //load the item using the parent method parent::load(); parse_str(str_replace(';', '&', $this->getState()->get('rrule')), $rrule); $rrule = new Registry(array_change_key_case($rrule)); $rrule->set('dtstart', $this->getState()->get('datestart')); $rrule->set('until', $this->getState()->get('dateend')); $rrule->set('id', $this->getState()->get('rrule_id')); /** @var Sp4kAppsRruleItem $rrule */ $rrule = Sp4kAppsRruleApp::getInstance($rrule)->getItem(); $rrule->dtstart = strftime('%Y%m%dT115959Z', $rrule->dtstart); $rrule->until = strftime('%Y%m%dT115959Z', $rrule->until); $this->getState()->set('rrule', $rrule->toString()); }
public function update() { parent::update(); $classname = 'Sp4kAppsSubscriptionPaymentMethods' . ucfirst($this->getState()->get('billing')); if (class_exists($classname)) { /** @var Sp4kAppsSubscriptionPaymentMethodsBank $paymentProcessor */ $paymentProcessor = new $classname(new Registry(['agreement' => ['account_config' => $this->getState()->get('billing'), 'user' => $this->getState()->get('juser'), 'paymentMonthInYear' => (int) strftime('%m', $this->getState()->get('billing_start')), 'paymentDayInMonth' => $this->getState()->get('paydate'), 'start' => strftime('%d/%m/%Y', $this->getState()->get('billing_start'))], 'paymentinfo' => $this->getState()->get('payinfo')])); //set up an account for this user if one does not already exist with the payment provider. $paymentProcessor->initializeAgreement(); if ($payment_error = $paymentProcessor->getError()) { $this->_error = $payment_error; } else { $this->state = 1; $this->status = 1; //failed/complete/unresolved/abandoned/cancelled/rejected $this->pm_ref_agreement_id = $paymentProcessor->agreement_id; $this->bind(); parent::update(); } } return; }
public function __construct($state) { parent::__construct($state); }
protected function bind() { parent::bind(); }
public function bind() { parent::bind(); }