createVariation() 공개 메소드

Creates a variation from a given Product and its dependencies.
public createVariation ( Sonata\Component\Product\ProductInterface $product, boolean $copyDependencies = true ) : Sonata\Component\Product\ProductInterface
$product Sonata\Component\Product\ProductInterface Product to duplicate
$copyDependencies boolean If false, duplicates only Product (without dependencies)
리턴 Sonata\Component\Product\ProductInterface
예제 #1
0
 /**
  * Returns a new travel variation entity
  *
  * @param \Sonata\Component\Product\ProductProviderInterface $provider
  * @param \Sonata\Component\Product\ProductInterface $parent
  *
  * @return Travel
  */
 protected function generateDefaultTravelVariation($provider, $parent)
 {
     $entity = $provider->createVariation($parent);
     $entity->setEnabled(true);
     return $entity;
 }