Esempio n. 1
0
 public function actionUpc()
 {
     $upcDB = new UpcDBApi();
     $upcCode = '070970400094';
     $output = $upcDB->getItemByUPC($upcCode);
     return $this->render('index', ['output' => $output]);
 }
Esempio n. 2
0
 public function afterSave($insert, $changedAttributes)
 {
     parent::afterSave($insert, $changedAttributes);
     if ($insert) {
         // update UpcDB Here
         $upcDB = new UpcDBApi();
         $itemDetails = array();
         $itemDetails['upc'] = $this->upc_barcode;
         $itemDetails['msrp'] = '0.00';
         $itemDetails['title'] = $this->wine_name;
         $itemDetails['alias'] = $this->wine_name;
         $itemDetails['description'] = $this->description;
         $result = $upcDB->createItem($itemDetails);
         if (!$result['success']) {
             $breakpoint_test = 'junk';
             //log the error, but don't blow up
         }
     }
 }