当前位置: 首页>>代码示例>>PHP>>正文


PHP Subscription::all方法代码示例

本文整理汇总了PHP中Subscription::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscription::all方法的具体用法?PHP Subscription::all怎么用?PHP Subscription::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Subscription的用法示例。


在下文中一共展示了Subscription::all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: unload

 public function unload()
 {
     $subscriptions = \Subscription::all();
     $columns = ["email", "created_at"];
     $firstRow = ["Email", "Дата создания"];
     return $this->unloadToCsv($subscriptions, ['columns' => $columns, 'firstRow' => $firstRow]);
 }
开发者ID:Khelek,项目名称:ipsol,代码行数:7,代码来源:SubscriptionsController.php

示例2: testCreateUpdateListCancel

 public function testCreateUpdateListCancel()
 {
     $planID = 'gold-' . self::generateRandomString(20);
     self::retrieveOrCreatePlan($planID);
     $customer = self::createTestCustomer();
     $sub = Subscription::create(array('plan' => $planID, 'customer' => $customer->id));
     $this->assertSame($sub->status, 'active');
     $this->assertSame($sub->plan->id, $planID);
     $sub->quantity = 2;
     $sub->save();
     $sub = Subscription::retrieve($sub->id);
     $this->assertSame($sub->status, 'active');
     $this->assertSame($sub->plan->id, $planID);
     $this->assertSame($sub->quantity, 2);
     // Update the quantity parameter one more time
     $sub = Subscription::update($sub->id, array("quantity" => 3));
     $this->assertSame($sub->status, 'active');
     $this->assertSame($sub->plan->id, $planID);
     $this->assertSame($sub->quantity, 3);
     $subs = Subscription::all(array('customer' => $customer->id, 'plan' => $planID, 'limit' => 3));
     $this->assertSame(get_class($subs->data[0]), 'Stripe\\Subscription');
     $sub->cancel(array('at_period_end' => true));
     $sub = Subscription::retrieve($sub->id);
     $this->assertSame($sub->status, 'active');
     $this->assertTrue($sub->cancel_at_period_end);
 }
开发者ID:wp-premium,项目名称:gravityformsstripe,代码行数:26,代码来源:SubscriptionTest.php

示例3: testAll

 public function testAll()
 {
     $planID = 'gold-' . self::randomString();
     self::retrieveOrCreatePlan($planID);
     $customer = self::createTestCustomer();
     $sub = Subscription::create(array('customer' => $customer->id, 'plan' => $planID));
     $planID_2 = 'gold-2-' . self::randomString();
     self::retrieveOrCreatePlan($planID_2);
     $sub_2 = Subscription::create(array('customer' => $customer->id, 'plan' => $planID_2));
     $subs = Subscription::all(array('limit' => 2, 'offset' => 0));
     $this->assertSame(2, count($subs['data']));
 }
开发者ID:payjp,项目名称:payjp-php,代码行数:12,代码来源:SubscriptionTest.php

示例4: filter

 function filter($condition = FALSE)
 {
     switch ($condition) {
         case 'active':
             $this->view_data['subscriptions'] = Subscription::find('all', array('conditions' => array('status = ?', 'Active')));
             break;
         case 'inactive':
             $this->view_data['subscriptions'] = Subscription::find('all', array('conditions' => array('status = ?', 'Inactive')));
             break;
         default:
             $this->view_data['subscriptions'] = Subscription::all();
             break;
     }
     $this->content_view = 'subscriptions/all';
 }
开发者ID:anteknik,项目名称:tomanage,代码行数:15,代码来源:subscriptions.php

示例5: session

 protected function session($user)
 {
     $this->setUser($user);
     $now = strftime("%Y-%m-%d", strtotime('now'));
     $session = Registry::get("session");
     $subscriptions = array();
     $subscription = \Subscription::all(array("user_id = ?" => $user->id, "live = ?" => true, "expiry > ?" => $now), array("item_id"));
     foreach ($subscription as $s) {
         $item = \Item::first(array("id = ?" => $s->item_id), array("name"));
         array_push($subscriptions, $item->name);
     }
     $session->set("subscriptions", $subscriptions);
 }
开发者ID:SwiftDeal,项目名称:detectr,代码行数:13,代码来源:controller.php

示例6: subscribed

 /**
  * @before _secure, _admin
  */
 public function subscribed($user_id)
 {
     $this->seo(array("title" => "Subscriptions", "keywords" => "admin", "description" => "admin", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $subscriptions = Subscription::all(array("user_id = ?" => $user_id), array("item_id", "created", "expiry"));
     $view->set("subs", $subscriptions);
 }
开发者ID:SwiftDeal,项目名称:detectr,代码行数:10,代码来源:member.php


注:本文中的Subscription::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。