public function getPriceInCents() { $price = parent::getPriceInCents(); if ($price === null) { return $price; } else { return (int) parent::getPriceInCents(); } }
public function save() { $this->subscriptionClassKey = PhabricatorHash::digestForIndex($this->subscriptionClass); $this->subscriptionRefKey = PhabricatorHash::digestForIndex($this->subscriptionRef); $is_new = !$this->getID(); $this->openTransaction(); // If we're saving this subscription for the first time, we're also // going to set up the trigger for it. if ($is_new) { $trigger_phid = PhabricatorPHID::generateNewPHID(PhabricatorWorkerTriggerPHIDType::TYPECONST); $this->setTriggerPHID($trigger_phid); } $result = parent::save(); if ($is_new) { $trigger_action = new PhabricatorScheduleTaskTriggerAction(array('class' => 'PhortuneSubscriptionWorker', 'data' => array('subscriptionPHID' => $this->getPHID()), 'options' => array('objectPHID' => $this->getPHID(), 'priority' => PhabricatorWorker::PRIORITY_BULK))); $trigger = $this->getTrigger(); $trigger->setPHID($trigger_phid); $trigger->setAction($trigger_action); $trigger->save(); } $this->saveTransaction(); return $result; }
protected function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array('name' => 'text255', 'description' => 'text', 'contactInfo' => 'text', 'invoiceEmail' => 'text255', 'invoiceFooter' => 'text', 'profileImagePHID' => 'phid?')) + parent::getConfiguration(); }
public function save() { $this->productClassKey = PhabricatorHash::digestForIndex($this->productClass); $this->productRefKey = PhabricatorHash::digestForIndex($this->productRef); return parent::save(); }
public function save() { if (!$this->getMailKey()) { $this->setMailKey(Filesystem::readRandomCharacters(20)); } return parent::save(); }
protected function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('metadata' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('name' => 'text255', 'status' => 'text64', 'brand' => 'text64', 'expires' => 'text16', 'lastFourDigits' => 'text16'), self::CONFIG_KEY_SCHEMA => array('key_account' => array('columns' => array('accountPHID', 'status')), 'key_merchant' => array('columns' => array('merchantPHID', 'accountPHID')))) + parent::getConfiguration(); }
public function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('metadata' => self::SERIALIZATION_JSON)) + parent::getConfiguration(); }
protected function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('metadata' => self::SERIALIZATION_JSON), self::CONFIG_APPLICATION_SERIALIZERS => array('basePriceAsCurrency' => new PhortuneCurrencySerializer()), self::CONFIG_COLUMN_SCHEMA => array('cartPHID' => 'phid?', 'basePriceAsCurrency' => 'text64', 'quantity' => 'uint32', 'status' => 'text32'), self::CONFIG_KEY_SCHEMA => array('key_cart' => array('columns' => array('cartPHID')))) + parent::getConfiguration(); }
protected function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('metadata' => self::SERIALIZATION_JSON), self::CONFIG_APPLICATION_SERIALIZERS => array('amountAsCurrency' => new PhortuneCurrencySerializer(), 'amountRefundedAsCurrency' => new PhortuneCurrencySerializer()), self::CONFIG_COLUMN_SCHEMA => array('paymentMethodPHID' => 'phid?', 'refundedChargePHID' => 'phid?', 'refundingPHID' => 'phid?', 'amountAsCurrency' => 'text64', 'amountRefundedAsCurrency' => 'text64', 'status' => 'text32'), self::CONFIG_KEY_SCHEMA => array('key_cart' => array('columns' => array('cartPHID')), 'key_account' => array('columns' => array('accountPHID')), 'key_merchant' => array('columns' => array('merchantPHID')), 'key_provider' => array('columns' => array('providerPHID')))) + parent::getConfiguration(); }
public function getConfiguration() { return array(self::CONFIG_AUX_PHID => true) + parent::getConfiguration(); }
protected function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array('name' => 'text255')) + parent::getConfiguration(); }