generateCategoryPath() public method

public generateCategoryPath ( $pathSeparator )
Exemplo n.º 1
0
 /**
  * Recursively updates the category paths.
  *
  * @param FootprintCategory $footprintCategory The footprint category to update
  * @param EntityManager     $entityManager     The entity manager
  */
 public function updateCategoryPaths(FootprintCategory $footprintCategory, OnFlushEventArgs $eventArgs)
 {
     $entityManager = $eventArgs->getEntityManager();
     $pathSeparator = $this->container->getParameter("partkeepr.category.path_separator");
     $footprintCategory->setCategoryPath($footprintCategory->generateCategoryPath($pathSeparator));
     $entityManager->getUnitOfWork()->recomputeSingleEntityChangeSet($entityManager->getClassMetadata(get_class($footprintCategory)), $footprintCategory);
     foreach ($footprintCategory->getChildren() as $child) {
         $this->updateCategoryPaths($child, $eventArgs);
     }
 }