コード例 #1
0
 public function getPriceInCents()
 {
     $price = parent::getPriceInCents();
     if ($price === null) {
         return $price;
     } else {
         return (int) parent::getPriceInCents();
     }
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 public function save()
 {
     $this->productClassKey = PhabricatorHash::digestForIndex($this->productClass);
     $this->productRefKey = PhabricatorHash::digestForIndex($this->productRef);
     return parent::save();
 }
コード例 #5
0
ファイル: PhortuneCart.php プロジェクト: rchicoli/phabricator
 public function save()
 {
     if (!$this->getMailKey()) {
         $this->setMailKey(Filesystem::readRandomCharacters(20));
     }
     return parent::save();
 }
コード例 #6
0
 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();
 }
コード例 #7
0
 public function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('metadata' => self::SERIALIZATION_JSON)) + parent::getConfiguration();
 }
コード例 #8
0
 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();
 }
コード例 #9
0
ファイル: PhortuneCharge.php プロジェクト: pugong/phabricator
 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();
 }
コード例 #10
0
 public function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true) + parent::getConfiguration();
 }
コード例 #11
0
 protected function getConfiguration()
 {
     return array(self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array('name' => 'text255')) + parent::getConfiguration();
 }