Пример #1
0
 public static function duplicateProvider()
 {
     $nodeType = Kernel::getService("em")->getRepository('RZ\\Roadiz\\Core\\Entities\\NodeType')->findOneByName('Page');
     $tran = Kernel::getService("em")->getRepository('RZ\\Roadiz\\Core\\Entities\\Translation')->findDefault();
     if (null !== $nodeType && null !== $tran) {
         $node = new Node($nodeType);
         $node->setNodeName("testNode" . uniqid());
         $node->setPublished(true);
         Kernel::getService("em")->persist($node);
         $src = new NSPage($node, $tran);
         $src->setTitle("testNode base");
         $src->setContent("This is TESTNODE!");
         Kernel::getService("em")->persist($src);
         Kernel::getService("em")->flush();
         return array(array($node));
     } else {
         return array();
     }
 }