Beispiel #1
0
 private static function prepare_node(midgardmvc_core_node $node, array $node_data, $destructive)
 {
     $node->title = $node_data['title'];
     $node->component = $node_data['component'];
     if ($destructive || !$node->content) {
         $node->content = $node_data['content'];
     }
     if ($node->guid) {
         $node->update();
     } else {
         if (isset($node_data['guid'])) {
             $node->set_guid($node_data['guid']);
         }
         $node->create();
     }
     if (isset($node_data['configuration'])) {
         $node->set_parameter('midgardmvc_core', 'configuration', midgardmvc_core::write_yaml($node_data['configuration']));
     }
     self::prepare_node_children($node, $node_data, $destructive);
 }