public static function initialize_plugin_data() { $globals = EZP_CS_JSON_Entity_Base::get_by_type(self::TYPE); if ($globals == null) { // RSR TODO: error checking here to ensure data doesnt get out of sync $display = EZP_CS_Display_Entity::create_with_defaults(); $display->save(); $content = EZP_CS_Content_Entity::create_with_defaults(); $content->save(); $set = EZP_CS_Set_Entity::create($display->id, $content->id); $set->save(); $config = EZP_CS_Config_Entity::create_with_defaults(); $config->save(); $global = new EZP_CS_Global_Entity(); $global->set("active_set_index", $set->id); $global->set("config_index", $config->id); $global->save(); } }