3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Helpers for managing SQL-backed queue items
21 * @see CRM_Queue_Queue_Sql
23 class CRM_Queue_BAO_QueueItem
extends CRM_Queue_DAO_QueueItem
{
26 * Ensure that the required SQL table exists.
29 * TRUE if table now exists
31 public static function findCreateTable() {
32 $checkTableSql = "show tables like 'civicrm_queue_item'";
33 $foundName = CRM_Core_DAO
::singleValueQuery($checkTableSql);
34 if ($foundName == 'civicrm_queue_item') {
38 // civicrm/sql/civicrm_queue_item.mysql
39 $fileName = dirname(__FILE__
) . '/../../../sql/civicrm_queue_item.mysql';
41 $config = CRM_Core_Config
::singleton();
42 CRM_Utils_File
::sourceSQLFile($config->dsn
, $fileName);
44 // Make sure it succeeded
45 $foundName = CRM_Core_DAO
::singleValueQuery($checkTableSql);
46 return ($foundName == 'civicrm_queue_item');