Inheritance: extends Elcodi\Component\Core\Entity\Abstracts\AbstractEntity, implements Elcodi\Component\Product\Entity\Interfaces\ProductInterface, use trait Elcodi\Component\Product\Entity\Traits\ProductPriceTrait, use trait Elcodi\Component\Core\Entity\Traits\DateTimeTrait, use trait Elcodi\Component\Core\Entity\Traits\EnabledTrait, use trait Elcodi\Component\Core\Entity\Traits\ETaggableTrait, use trait Elcodi\Component\MetaData\Entity\Traits\MetaDataTrait, use trait Elcodi\Component\Media\Entity\Traits\ImagesContainerTrait, use trait Elcodi\Component\Media\Entity\Traits\PrincipalImageTrait
 /**
  * Gets a new product
  *
  * @param integer $id The product id.
  *
  * @return Product
  */
 public function getNewProduct($id)
 {
     $product = new Product();
     $product->setId($id);
     $product->setCategories(new ArrayCollection());
     return $product;
 }
Example #2
0
 /**
  * Shortcut method to assert product Attribute collection size
  *
  * @param Product $product
  * @param         $size
  */
 private function assertProductAttributeCollectionSizeIs(Product $product, $size)
 {
     $this->assertEquals($size, $product->getAttributes()->count());
 }
 /**
  * Gets a new categorizable purchasable.
  *
  * @param int $id The purchasable id.
  *
  * @return ProductInterface
  */
 public function getNewCategorizablePurchasable($id)
 {
     $purchasable = new Product();
     $purchasable->setId($id);
     $purchasable->setCategories(new ArrayCollection());
     return $purchasable;
 }