From 0038409ffccf568ad47030693f49a24b8f9cb2f5 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 15 Jun 2018 17:40:39 -0700 Subject: [PATCH] CRM_Utils_SQL_TempTable - Improve docblock --- CRM/Utils/SQL/TempTable.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/SQL/TempTable.php b/CRM/Utils/SQL/TempTable.php index 8e419789b4..cedc46c816 100644 --- a/CRM/Utils/SQL/TempTable.php +++ b/CRM/Utils/SQL/TempTable.php @@ -36,10 +36,16 @@ * - Durable temp tables: "civicrm_tmp_d_{12}_{32}" * - Ephemeral temp tables: "civicrm_tmp_e_{12}_{32}" * - * Example 1: Just create table name. You'll be responsible for CREATE/DROP actions. + * To use `TempTable`: + * - Begin by calling `CRM_Utils_SQL_TempTable::build()`. + * - Optionally, describe the table with `setDurable()`, `setCategory()`, `setId()`. + * - Finally, call `getName()` or `createWithQuery()` or `createWithColumns()`. + * + * Example 1: Just create a table name. You'll be responsible for CREATE/DROP actions. * * $name = CRM_Utils_SQL_TempTable::build()->getName(); * $name = CRM_Utils_SQL_TempTable::build()->setDurable()->getName(); + * $name = CRM_Utils_SQL_TempTable::build()->setCategory('contactstats')->setId($contact['id'])->getName(); * * Example 2: Create a temp table using the results of a SELECT query. * -- 2.25.1