<?php

/**
 * @package CRM
 * @copyright CiviCRM LLC https://civicrm.org/licensing
 *
 * Generated from /xml/schema/CRM/Shimmy/ShimThing.xml
 * DO NOT EDIT.  Generated by CRM_Core_CodeGen
 * (GenCodeChecksum:1043dfe0f6d600e56520a94c3fb6f89d)
 */

/**
 * Database access object for the ShimThing entity.
 */
class CRM_Shimmy_DAO_ShimThing extends CRM_Core_DAO {
  const EXT = 'civicrm';
  const TABLE_ADDED = '';

  /**
   * Static instance to hold the table name.
   *
   * @var string
   */
  public static $_tableName = 'civicrm_shim_thing';

  /**
   * Icon associated with this entity.
   *
   * @var string
   */
  public static $_icon = 'fa-clone';

  /**
   * Should CiviCRM log any modifications to this table in the civicrm_log table.
   *
   * @var bool
   */
  public static $_log = TRUE;

  /**
   * Unique ShimThing ID
   *
   * @var int|string|null
   *   (SQL type: int unsigned)
   *   Note that values will be retrieved from the database as a string.
   */
  public $id;

  /**
   * Unique name for the shim thing
   *
   * @var string
   *   (SQL type: varchar(255))
   *   Note that values will be retrieved from the database as a string.
   */
  public $name;

  /**
   * Class constructor.
   */
  public function __construct() {
    $this->__table = 'civicrm_shim_thing';
    parent::__construct();
  }

  /**
   * Returns localized title of this entity.
   *
   * @param bool $plural
   *   Whether to return the plural version of the title.
   */
  public static function getEntityTitle($plural = FALSE) {
    return $plural ? ts('Shim Things') : ts('Shim Thing');
  }

  /**
   * Returns all the column names of this table
   *
   * @return array
   */
  public static function &fields() {
    if (!isset(Civi::$statics[__CLASS__]['fields'])) {
      Civi::$statics[__CLASS__]['fields'] = [
        'id' => [
          'name' => 'id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('ShimThing ID'),
          'description' => ts('Unique ShimThing ID'),
          'required' => TRUE,
          'where' => 'civicrm_shim_thing.id',
          'table_name' => 'civicrm_shim_thing',
          'entity' => 'ShimThing',
          'bao' => 'CRM_Shimmy_DAO_ShimThing',
          'localizable' => 0,
          'readonly' => TRUE,
          'add' => '1.0',
        ],
        'name' => [
          'name' => 'name',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('ShimThing Name'),
          'description' => ts('Unique name for the shim thing'),
          'required' => TRUE,
          'maxlength' => 255,
          'size' => CRM_Utils_Type::HUGE,
          'where' => 'civicrm_shim_thing.name',
          'table_name' => 'civicrm_shim_thing',
          'entity' => 'ShimThing',
          'bao' => 'CRM_Shimmy_DAO_ShimThing',
          'localizable' => 0,
          'html' => [
            'type' => 'Text',
          ],
          'add' => '1.0',
        ],
      ];
      CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
    }
    return Civi::$statics[__CLASS__]['fields'];
  }

  /**
   * Returns the list of indices
   *
   * @param bool $localize
   *
   * @return array
   */
  public static function indices($localize = TRUE) {
    $indices = [];
    return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
  }

}
