/**
  * @role create
  */
 public function create()
 {
     $request = $this->getRequest();
     $rpp = RecurringProductPeriod::getNewInstance(Product::getInstanceByID((int) $request->get('productID'), ActiveRecord::LOAD_DATA));
     $rpp->position->set(1000);
     return $this->save($rpp);
 }
Пример #2
0
 private function createRecurringProductPeriod($product, $periodLength = 28, $periodType = 1, $rebillCount = 100)
 {
     $rpp = RecurringProductPeriod::getNewInstance($product);
     $rpp->name->set('Test recurring #' . floor(mt_rand() * 1000));
     $rpp->periodLength->set($periodLength);
     $rpp->periodType->set($periodType);
     $rpp->rebillCount->set($rebillCount);
     $rpp->description->set('Test recurring product period');
     $rpp->save();
     return $rpp;
 }