예제 #1
0
 /**
  *
  */
 public function reactivateAction()
 {
     $id = $this->getRequest()->getParam('id');
     $rangeAndVolume = RangeAndVolumeQuery::create()->findByPKOrThrow($id, $this->i18n->_("Not exists the RangeAndVolume with id {$id}"));
     try {
         $this->getRangeAndVolumeCatalog()->beginTransaction();
         $this->getRangeAndVolumeCatalog()->update($rangeAndVolume);
         $this->getRangeAndVolumeCatalog()->commit();
         $this->setFlash('ok', $this->i18n->_("Se reactivo correctamente el RangeAndVolume"));
     } catch (Exception $e) {
         $this->getRangeAndVolumeCatalog()->rollBack();
         $this->setFlash('error', $this->i18n->_($e->getMessage()));
     }
     $this->_redirect('range-and-volume/list');
 }
예제 #2
0
 /**
  *
  */
 public function getRangeAndVolumeAction()
 {
     $value = $this->getRequest()->getParam('value');
     if (!$value) {
         $value = 0;
     }
     $rangeAndVolume = RangeAndVolumeQuery::create()->whereAdd(RangeAndVolume::RANGE, $value, RangeAndVolumeQuery::GREATER_THAN)->orderBy(RangeAndVolume::RANGE, RangeAndVolumeQuery::ASC)->findOne()->toArray();
     die(json_encode($rangeAndVolume));
 }