3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/File.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:996b2702471b24fb13c740ef104ea1f9)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_File constructor.
40 class CRM_Core_DAO_File
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_file';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.
66 * mime type of the document
72 * uri of the file on disk
78 * contents of the document
84 * Additional descriptive text regarding this attachment (optional).
90 * Date and time that this attachment was uploaded or written to server.
98 function __construct() {
99 $this->__table
= 'civicrm_file';
100 parent
::__construct();
103 * Returns all the column names of this table
107 static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = array(
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('File ID') ,
114 'description' => 'Unique ID',
116 'table_name' => 'civicrm_file',
118 'bao' => 'CRM_Core_BAO_File',
121 'file_type_id' => array(
122 'name' => 'file_type_id',
123 'type' => CRM_Utils_Type
::T_INT
,
124 'title' => ts('File Type') ,
125 'description' => 'Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.',
126 'table_name' => 'civicrm_file',
128 'bao' => 'CRM_Core_BAO_File',
131 'mime_type' => array(
132 'name' => 'mime_type',
133 'type' => CRM_Utils_Type
::T_STRING
,
134 'title' => ts('Mime Type') ,
135 'description' => 'mime type of the document',
137 'size' => CRM_Utils_Type
::HUGE
,
138 'table_name' => 'civicrm_file',
140 'bao' => 'CRM_Core_BAO_File',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Path') ,
147 'description' => 'uri of the file on disk',
149 'size' => CRM_Utils_Type
::HUGE
,
150 'table_name' => 'civicrm_file',
152 'bao' => 'CRM_Core_BAO_File',
156 'name' => 'document',
157 'type' => CRM_Utils_Type
::T_MEDIUMBLOB
,
158 'title' => ts('File Contents') ,
159 'description' => 'contents of the document',
160 'table_name' => 'civicrm_file',
162 'bao' => 'CRM_Core_BAO_File',
165 'description' => array(
166 'name' => 'description',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('File Description') ,
169 'description' => 'Additional descriptive text regarding this attachment (optional).',
171 'size' => CRM_Utils_Type
::HUGE
,
172 'table_name' => 'civicrm_file',
174 'bao' => 'CRM_Core_BAO_File',
177 'upload_date' => array(
178 'name' => 'upload_date',
179 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
180 'title' => ts('File Upload Date') ,
181 'description' => 'Date and time that this attachment was uploaded or written to server.',
182 'table_name' => 'civicrm_file',
184 'bao' => 'CRM_Core_BAO_File',
188 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
190 return Civi
::$statics[__CLASS__
]['fields'];
193 * Return a mapping from field-name to the corresponding key (as used in fields()).
196 * Array(string $name => string $uniqueName).
198 static function &fieldKeys() {
199 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
200 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
202 return Civi
::$statics[__CLASS__
]['fieldKeys'];
205 * Returns the names of this table
209 static function getTableName() {
210 return self
::$_tableName;
213 * Returns if this table needs to be logged
221 * Returns the list of fields that can be imported
223 * @param bool $prefix
227 static function &import($prefix = false) {
228 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'file', $prefix, array());
232 * Returns the list of fields that can be exported
234 * @param bool $prefix
238 static function &export($prefix = false) {
239 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'file', $prefix, array());