Exemple #1
0
 public function processScheduledUpdate($em, $node, AdapterInterface $ea)
 {
     parent::processScheduledUpdate($em, $node, $ea);
     $meta = $em->getClassMetadata(get_class($node));
     $config = $this->listener->getConfiguration($em, $meta->name);
     $uow = $em->getUnitOfWork();
     $changeSet = $uow->getEntityChangeSet($node);
     // Vitiko: при обновлении рубрики если изменилмся ее путь но не изменились другие данные - обновить fullPath
     if ($this->isUseMaterializedPath($config) && isset($changeSet[$config['path_source']]) && !(isset($changeSet[$config['left']]) || isset($changeSet[$config['parent']]))) {
         $parent = isset($changeSet[$config['parent']]) ? $changeSet[$config['parent']][1] : $node->getParent();
         $wrappedParent = AbstractWrapper::wrap($parent, $em);
         $meta->getReflectionProperty($config['path'])->setValue($node, $wrappedParent->getPropertyValue($config['path']) . $changeSet[$config['path_source']][1] . ($config['path_ends_with_separator'] ? $config['path_separator'] : ''));
     }
     if ($this->isUseMaterializedPath($config) && (isset($changeSet[$config['parent']]) || isset($changeSet[$config['path_source']]))) {
         $this->updateChildrenPath($em, $node);
     }
 }