/**
  * @param ObjectManager $manager
  * @param NodeInterface $node
  */
 protected function generateRouteNode(ObjectManager $manager, $node)
 {
     $site = $this->getReference('site3');
     foreach ($site->getAliases() as $key => $alias) {
         if ($alias->getLanguage() == $node->getLanguage()) {
             $route = new RouteDocument();
             $route->setName($key . '_' . $node->getId());
             $route->setHost($alias->getDomain());
             $scheme = $alias->getScheme();
             $route->setSchemes($scheme);
             $route->setLanguage($node->getLanguage());
             $route->setNodeId($node->getNodeId());
             $route->setSiteId($site->getSiteId());
             $route->setAliasId($key);
             $route->setPattern($node->getRoutePattern());
             $manager->persist($route);
         }
     }
 }
コード例 #2
0
 /**
  * @param NodeInterface $node
  *
  * @return FacadeInterface
  */
 public function transformVersion($node)
 {
     $facade = $this->newFacade();
     $facade->id = $node->getId();
     $facade->nodeId = $node->getNodeId();
     $facade->name = $node->getName();
     $facade->version = $node->getVersion();
     $facade->createdBy = $node->getCreatedBy();
     $facade->updatedBy = $node->getUpdatedBy();
     $facade->createdAt = $node->getCreatedAt();
     $facade->updatedAt = $node->getUpdatedAt();
     $facade->status = $this->getTransformer('status')->transform($node->getStatus());
     return $facade;
 }