CRM_Utils_SQL_TempTable - Improve docblock
authorTim Otten <totten@civicrm.org>
Sat, 16 Jun 2018 00:40:39 +0000 (17:40 -0700)
committerTim Otten <totten@civicrm.org>
Sat, 16 Jun 2018 00:40:39 +0000 (17:40 -0700)
CRM/Utils/SQL/TempTable.php

index 8e419789b49de5c010f62184b45b5b8157887b36..cedc46c816221adf3824df21a3298825108df015 100644 (file)
  *   - 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.
  *