function testIsNotUniversal()
 {
     $product = new Elite_Vaf_Model_Catalog_Product();
     $product->setId(1);
     $product->setUniversal(false);
     $this->assertFalse($product->isUniversal());
 }
Пример #2
0
 /**
  * @var integer product id
  * @var mixed boolean false for universal, or Elite_Vaf_Model_Vehicle to create a mapping for
  */
 function insertMapping($row, $vehicle)
 {
     $sku = $this->sku($row);
     $productId = $this->productId($sku);
     if (!$productId) {
         $this->skipped_mappings++;
         return;
     }
     if ($this->isUniversal($row)) {
         $product = new Elite_Vaf_Model_Catalog_Product();
         $product->setId($productId);
         $product->setUniversal(1);
         return;
     }
     if (false === $vehicle) {
         $this->invalid_vehicle_count++;
         $this->skipped_mappings++;
         return;
     }
     $mapping = new Elite_Vaf_Model_Mapping($productId, $vehicle);
     if ($this->hasMapping($productId, $vehicle)) {
         $this->already_existing_mappings++;
         $this->skipped_mappings++;
         return $mapping->save();
     }
     $mapping_id = $mapping->save();
     if (!$mapping_id) {
         $this->skipped_mappings++;
     } else {
         $this->added_mappings++;
     }
     return $mapping_id;
 }