/** * * @param type $template_key * @return EZP_CS_Display_Entity */ public static function create_from_template($template_key) { EZP_CS_Utility::debug("copying from template {$template_key}"); $template_directory = EZP_CS_Utility::$MINI_THEMES_TEMPLATE_DIRECTORY . $template_key; $metadata_path = $template_directory . "/display.json"; $display_json = file_get_contents($metadata_path); $mixed = json_decode($display_json); EZP_CS_Utility::debug_dump("mixed from template", $mixed); $new = self::create_from_mixed($mixed); EZP_CS_Utility::debug_dump("after copy from template", $new); return $new; }