BMLT Root Server
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
c_comdef_format Class Reference

A Class for Format Codes. More...

Public Member Functions

 UpdateToDB ($is_rollback=false)
 Updates the DB to the current values of this instance. (replacing current values of the DB). More...
 
 DeleteFromDB_NoRecord ()
 Deletes this instance from the database without recording it. More...
 
 DeleteFromDB ()
 Deletes this instance from the database. More...
 
 RestoreFromDB ()
 Updates this instance to the current values in the DB (replacing current values of the instance). More...
 
 __construct ($in_parent_obj, $in_shared_id_bigint=null, $in_format_type_string=null, $in_key_string=null, $in_icon_blob=null, $in_worldid_mixed=null, $in_lang_enum=null, $in_name_string=null, $in_description_string=null)
 The initial setup call for the class. If you send in values, the object will set itself up to use them. More...
 
 SetSharedID ($in_shared_id_bigint)
 Accessor -Set the shared ID. More...
 
 GetSharedID ()
 Accessor -Get a reference to the shared ID. More...
 
 SetFormatType ($in_format_type_string)
 Accessor -Sets the format type code. More...
 
GetFormatType ()
 Accessor -Returns a reference to the format type code. More...
 
 SetKey ($in_key_string)
 Accessor -Sets the format key (the 1-3 letter code that represents the format). More...
 
GetKey ()
 Accessor -Returns a reference to the _key_string data member. More...
 
 SetIcon ($in_icon_blob)
 Accessor -Sets a 64-pixel-square image (as a GIF), to be used to indicate the format. More...
 
GetIcon ()
 Accessor -Returns a reference to the _icon_blob data member. More...
 
 SetFormatCodes ($in_format_code_array)
 Accessor -Sets a brief description string for the format, in whatever language has been selected. More...
 
GetFormatCodes ()
 Accessor -Returns a reference to the _format_codes data member. More...
 
 SerializeObject ()
 Returns a storable serialization of the object, as a string. More...
 
 UserCanEdit ($in_user_object=null)
 Test to see if a user is allowed to edit an instance (change the data). More...
 
- Public Member Functions inherited from t_comdef_world_type
 SetWorldID ($in_worldid_mixed)
 Accessor -Sets the _world_type_worldid_mixed data member. More...
 
 GetWorldID ()
 Accessor -Returns a reference to the _world_type_worldid_mixed data member. More...
 
- Public Member Functions inherited from t_comdef_local_type
 SetLocalLang ($in_lang_enum=null)
 Sets the language. More...
 
 GetLocalLang ()
 Returns a reference to the local language setting. More...
 
 SetLocalName ($in_name_string)
 Accessor -Sets the _local_type_name_string data member. More...
 
 GetLocalName ()
 Accessor -Returns a reference to the _local_type_name_string data member. More...
 
 SetLocalDescription ($in_description_string)
 Accessor -Sets the _local_type_desc_string data member. More...
 
 GetLocalDescription ()
 Accessor -Returns a reference to the _local_type_desc_string data member. More...
 
- Public Member Functions inherited from t_local_id_class
 SetParentObj ($in_parent_obj)
 Sets the object's "parent" (Container) object, as a reference. More...
 
 GetParentObj ()
 Returns a reference to the object's container. More...
 
- Public Member Functions inherited from i_comdef_db_stored
 UpdateToDB ()
 This causes the object to update the database to its current state. More...
 

Static Public Member Functions

static UnserializeObject ($in_parent, $serialized_array)
 This takes the serialized data, and instantiates a new object from it. More...
 

Public Attributes

 $_shared_id_bigint = null
 The shared ID (for multiple instances of the same format code). More...
 
 $_format_type_string = null
 This is the type of format. More...
 
 $_key_string = null
 The Format Key, in Text Form. More...
 
 $_icon_blob = null
 The Format Icon, as a 64-pixel-square Icon, in GIF format. More...
 
 $_format_codes = null
 This will be an array of the format types (localized). More...
 

Detailed Description

A Class for Format Codes.

This class handles the model for the NA Meeting Format Codes. The codes are stored one code per language per instance of this class. If codes are related (Same code, different languages), then you should give them all the same shared ID.

Definition at line 37 of file c_comdef_format.class.php.

Constructor & Destructor Documentation

__construct (   $in_parent_obj,
  $in_shared_id_bigint = null,
  $in_format_type_string = null,
  $in_key_string = null,
  $in_icon_blob = null,
  $in_worldid_mixed = null,
  $in_lang_enum = null,
  $in_name_string = null,
  $in_description_string = null 
)

The initial setup call for the class. If you send in values, the object will set itself up to use them.

This is the server language.

Should never be necessary.

This gets us the format codes, with their localized descriptions.

Parameters
$in_parent_objThe object that "owns" this instance.
$in_shared_id_bigintThe shared ID (If this is the same as other formats -used for different languages).
$in_key_stringThe format Key, as a text string (1-3 Characters).
$in_icon_blobThe format icon, as 64-pixel-square GIF image data.
$in_worldid_mixedThe t_comdef_world_type Class: The NAWS ID for this format (can be the same as other format IDs)
$in_lang_enumThe t_comdef_local_type Class The language to be used for this instance (if null, the server language is used).
$in_name_stringThe name of this instance
$in_description_stringA verbose description

Definition at line 280 of file c_comdef_format.class.php.

References $comdef_global_language.

297  {
298  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
300 
301  /// This is the server language.
302  if (null == $in_lang_enum) {
303  $in_lang_enum = $comdef_global_language;
304  }
305 
306  /// Should never be necessary.
307  if (null == $in_lang_enum) {
308  $in_lang_enum = "en";
309  }
310 
311  $this->SetSharedID($in_shared_id_bigint);
312  $this->SetFormatType($in_format_type_string);
313  $this->SetKey($in_key_string);
314  $this->SetIcon($in_icon_blob);
315 
316  $this->SetParentObj($in_parent_obj);
317 
318  $this->SetLocalLang($in_lang_enum);
319  $this->SetLocalName($in_name_string);
320  $this->SetLocalDescription($in_description_string);
321 
322  $this->SetWorldID($in_worldid_mixed);
323 
324  /// This gets us the format codes, with their localized descriptions.
325 // $file_path = dirname ( __FILE__ ).'/../../local_server/server_admin/lang/'.$in_lang_enum.'/format_codes.inc.php';
326 //
327 // require ( $file_path );
328 //
329 // $this->SetFormatCodes ( $comdef_format_types );
330  }
SetLocalName($in_name_string)
Accessor -Sets the _local_type_name_string data member.
SetParentObj($in_parent_obj)
Sets the object's "parent" (Container) object, as a reference.
SetKey($in_key_string)
Accessor -Sets the format key (the 1-3 letter code that represents the format).
global $comdef_global_language
The local server language enum (Will default to English)
SetLocalDescription($in_description_string)
Accessor -Sets the _local_type_desc_string data member.
SetFormatType($in_format_type_string)
Accessor -Sets the format type code.
SetSharedID($in_shared_id_bigint)
Accessor -Set the shared ID.
SetWorldID($in_worldid_mixed)
Accessor -Sets the _world_type_worldid_mixed data member.
SetIcon($in_icon_blob)
Accessor -Sets a 64-pixel-square image (as a GIF), to be used to indicate the format.
SetLocalLang($in_lang_enum=null)
Sets the language.

Member Function Documentation

DeleteFromDB ( )

Deletes this instance from the database.

Exceptions
aPDOException if there is a problem.

Implements i_comdef_db_stored.

Definition at line 197 of file c_comdef_format.class.php.

References $ret, c_comdef_server\AddNewChange(), c_comdef_server\GetCurrentUserObj(), and c_comdef_server\GetOneFormat().

198  {
199  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
200  $ret = false;
201 
203 
204  if ($this->UserCanEdit($user)) {
205  // We take a snapshot of the user as it currently sits in the database as a "before" image.
206  $before = null;
207  $before_id = null;
208  $before_lang = null;
209  $before_obj = c_comdef_server::GetOneFormat($this->GetSharedID(), $this->GetLocalLang());
210 
211  if ($before_obj instanceof c_comdef_format) {
212  $before = $before_obj->SerializeObject();
213  $before_id = $before_obj->GetSharedID();
214  $before_lang = $before_obj->GetLocalLang();
215  $before_obj = null;
216  }
217 
218  $ret = $this->DeleteFromDB_NoRecord();
219 
220  if ($ret) {
221  c_comdef_server::AddNewChange($user->GetID(), 'comdef_change_type_delete', $this->GetSharedID(), $before, null, 'c_comdef_format', $before_id, null, $before_lang, null);
222  }
223  }
224 
225  return $ret;
226  }
static AddNewChange($in_user_id_bigint, $in_change_type, $in_service_body_id_bigint, $in_before_string, $in_after_string, $in_object_class_string, $in_before_obj_id_bigint, $in_after_obj_id_bigint, $in_before_obj_lang_enum=null, $in_after_obj_lang_enum=null, $in_name_string=null, $in_description_string=null, $in_lang_enum=null)
Creates a new change record in the Database.
GetSharedID()
Accessor -Get a reference to the shared ID.
GetLocalLang()
Returns a reference to the local language setting.
$ret
Definition: contact.php:226
UserCanEdit($in_user_object=null)
Test to see if a user is allowed to edit an instance (change the data).
DeleteFromDB_NoRecord()
Deletes this instance from the database without recording it.
static GetOneFormat($in_id_bigint, $in_lang_enum)
Given an ID and a language for a format, it returns one instance.
A Class for Format Codes.
static GetCurrentUserObj($in_is_ajax=false)
Get the current logged-in user, as a c_comdef_user instance.
DeleteFromDB_NoRecord ( )

Deletes this instance from the database without recording it.

Returns
true, if the delete was successful. False, otherwise.
Exceptions
aPDOException if there is a problem.

Definition at line 167 of file c_comdef_format.class.php.

References $_COMDEF_DEBUG, $ret, and c_comdef_dbsingleton\preparedExec().

168  {
169  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
170  $ret = false;
171 
172  if ($this->UserCanEdit()) {
173  try {
174  $sql = "DELETE FROM `".c_comdef_server::GetFormatTableName_obj()."` WHERE shared_id_bigint=? AND lang_enum=?";
175  c_comdef_dbsingleton::preparedExec($sql, array ( $this->GetSharedID(), $this->GetLocalLang() ));
176  $ret = true;
177  } catch (Exception $ex) {
178  global $_COMDEF_DEBUG;
179 
180  if ($_COMDEF_DEBUG) {
181  echo "Exception Thrown in c_comdef_format::DeleteFromDB_NoRecord()!<br />";
182  var_dump($ex);
183  }
184  throw ( $ex );
185  }
186  }
187 
188  return $ret;
189  }
GetSharedID()
Accessor -Get a reference to the shared ID.
static preparedExec($sql, $params=array())
Wrapper for preparing and executing a PDOStatement that does not return a resultset e...
GetLocalLang()
Returns a reference to the local language setting.
$ret
Definition: contact.php:226
UserCanEdit($in_user_object=null)
Test to see if a user is allowed to edit an instance (change the data).
global $_COMDEF_DEBUG
This flag, when set to true, will cause extra debug information to be output.
& GetFormatCodes ( )

Accessor -Returns a reference to the _format_codes data member.

Returns
The _format_codes data member, as a reference.

Definition at line 453 of file c_comdef_format.class.php.

454  {
455  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
456  return $this->_format_codes;
457  }
$_format_codes
This will be an array of the format types (localized).
& GetFormatType ( )

Accessor -Returns a reference to the format type code.

Returns
The _format_type_string data member, as a reference.

Definition at line 381 of file c_comdef_format.class.php.

382  {
383  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
385  }
$_format_type_string
This is the type of format.
& GetIcon ( )

Accessor -Returns a reference to the _icon_blob data member.

Returns
The _icon_blob data member, as a reference.

Definition at line 429 of file c_comdef_format.class.php.

430  {
431  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
432  return $this->_icon_blob;
433  }
$_icon_blob
The Format Icon, as a 64-pixel-square Icon, in GIF format.
& GetKey ( )

Accessor -Returns a reference to the _key_string data member.

Returns
The _key_string data member, as a reference.

Definition at line 405 of file c_comdef_format.class.php.

406  {
407  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
408  return $this->_key_string;
409  }
$_key_string
The Format Key, in Text Form.
GetSharedID ( )

Accessor -Get a reference to the shared ID.

Returns
The _shared_id_bigint data member, as a reference.

Definition at line 353 of file c_comdef_format.class.php.

354  {
355  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
357  }
$_shared_id_bigint
The shared ID (for multiple instances of the same format code).
RestoreFromDB ( )

Updates this instance to the current values in the DB (replacing current values of the instance).

Exceptions
aPDOException if there is a problem.

Implements i_comdef_db_stored.

Definition at line 235 of file c_comdef_format.class.php.

References $_COMDEF_DEBUG, and c_comdef_dbsingleton\preparedQuery().

236  {
237  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
238  try {
239  $sql = "SELECT * FROM `".c_comdef_server::GetFormatTableName_obj()."` WHERE shared_id_bigint=? AND lang_enum=?";
240 
241  $vals = array ( intval($this->GetLocalID(), $this->GetLocalLang()) );
242 
243  $rows = c_comdef_dbsingleton::preparedQuery($sql, $vals);
244 
245  if (is_array($rows) && count($rows)) {
246  $this->SetSharedID($rs['shared_id_bigint']);
247  $this->SetFormatType($rs['format_type_enum']);
248  $this->SetKey($rs['key_string']);
249  $this->SetIcon($rs['icon_blob']);
250  $this->SetWorldID($rs['worldid_mixed']);
251  $this->SetLocalLang($rs['lang_enum']);
252  $this->SetLocalName($rs['name_string']);
253  $this->SetLocalDescription($rs['description_string']);
254  } else {
255  global $_COMDEF_DEBUG;
256 
257  if ($_COMDEF_DEBUG) {
258  echo "Exception Thrown in c_comdef_format::RestoreFromDB()!<br />";
259  var_dump($ex);
260  }
261  throw ( $ex );
262  }
263  } catch (Exception $ex) {
264  global $_COMDEF_DEBUG;
265 
266  if ($_COMDEF_DEBUG) {
267  echo "Exception Thrown in c_comdef_format::RestoreFromDB()!<br />";
268  var_dump($ex);
269  }
270  throw ( $ex );
271  }
272  }
SetLocalName($in_name_string)
Accessor -Sets the _local_type_name_string data member.
GetLocalLang()
Returns a reference to the local language setting.
SetKey($in_key_string)
Accessor -Sets the format key (the 1-3 letter code that represents the format).
static preparedQuery($sql, $params=array(), $fetchKeyPair=false)
Wrapper for preparing and executing a PDOStatement that returns a resultset e.g. SELECT SQL statement...
SetLocalDescription($in_description_string)
Accessor -Sets the _local_type_desc_string data member.
SetFormatType($in_format_type_string)
Accessor -Sets the format type code.
SetSharedID($in_shared_id_bigint)
Accessor -Set the shared ID.
SetWorldID($in_worldid_mixed)
Accessor -Sets the _world_type_worldid_mixed data member.
global $_COMDEF_DEBUG
This flag, when set to true, will cause extra debug information to be output.
SetIcon($in_icon_blob)
Accessor -Sets a 64-pixel-square image (as a GIF), to be used to indicate the format.
SetLocalLang($in_lang_enum=null)
Sets the language.
SerializeObject ( )

Returns a storable serialization of the object, as a string.

This is only used for the changes, as the serialized string may not be easily searched.

Returns
an array, containing the object in serialized form.

Implements i_comdef_serialized.

Definition at line 468 of file c_comdef_format.class.php.

469  {
470  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
471  $s_array['shared_id_bigint'] = $this->GetSharedID();
472  $s_array['format_type_string'] = $this->GetFormatType();
473  $s_array['key_string'] = $this->GetKey();
474  $s_array['icon_blob'] = $this->GetIcon();
475  $s_array['worldid_mixed'] = $this->GetWorldID();
476  $s_array['lang_enum'] = $this->GetLocalLang();
477  $s_array['name_string'] = $this->GetLocalName();
478  $s_array['description_string'] = $this->GetLocalDescription();
479 
480  return serialize($s_array);
481  }
GetLocalDescription()
Accessor -Returns a reference to the _local_type_desc_string data member.
GetSharedID()
Accessor -Get a reference to the shared ID.
GetLocalLang()
Returns a reference to the local language setting.
GetLocalName()
Accessor -Returns a reference to the _local_type_name_string data member.
& GetFormatType()
Accessor -Returns a reference to the format type code.
& GetIcon()
Accessor -Returns a reference to the _icon_blob data member.
& GetKey()
Accessor -Returns a reference to the _key_string data member.
GetWorldID()
Accessor -Returns a reference to the _world_type_worldid_mixed data member.
SetFormatCodes (   $in_format_code_array)

Accessor -Sets a brief description string for the format, in whatever language has been selected.

< Make sure we copy it.

Parameters
$in_format_code_arrayAn associative array, with the format codes.

Definition at line 439 of file c_comdef_format.class.php.

441  {
442  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
443  $this->_format_codes = null;
444  $this->_format_codes = $in_format_code_array; ///< Make sure we copy it.
445  }
SetFormatType (   $in_format_type_string)

Accessor -Sets the format type code.

Definition at line 363 of file c_comdef_format.class.php.

369  {
370  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
371  $this->_format_type_string = null;
372  $this->_format_type_string = $in_format_type_string;
373  }
SetIcon (   $in_icon_blob)

Accessor -Sets a 64-pixel-square image (as a GIF), to be used to indicate the format.

Parameters
$in_icon_blobThe GIF image, as a stream of binary data.

Definition at line 415 of file c_comdef_format.class.php.

417  {
418  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
419  $this->_icon_blob = null;
420  $this->_icon_blob = $in_icon_blob;
421  }
SetKey (   $in_key_string)

Accessor -Sets the format key (the 1-3 letter code that represents the format).

Parameters
$in_key_stringThe format Key, as a text string (1-3 Characters)

Definition at line 391 of file c_comdef_format.class.php.

393  {
394  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
395  $this->_key_string = null;
396  $this->_key_string = $in_key_string;
397  }
SetSharedID (   $in_shared_id_bigint)

Accessor -Set the shared ID.

The shared ID may be the same for a number of different instances. It is how we link different language versions of the same format together.

Parameters
$in_shared_id_bigintThe shared ID (If this is the same as other formats -used for different languages).

Definition at line 339 of file c_comdef_format.class.php.

341  {
342  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
343  $this->_shared_id_bigint = null;
344  $this->_shared_id_bigint = $in_shared_id_bigint;
345  }
static UnserializeObject (   $in_parent,
  $serialized_array 
)
static

This takes the serialized data, and instantiates a new object from it.

Returns
a new instance of c_comdef_format, set up according to the serialized data passed in.
Parameters
$in_parentThe parent object.
$serialized_arrayAn array containing the serialized data.

Implements i_comdef_serialized.

Definition at line 491 of file c_comdef_format.class.php.

Referenced by c_comdef_change\GetAfterObject(), and c_comdef_change\GetBeforeObject().

494  {
495  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
496  $s_array = unserialize($serialized_array);
497 
498  return new c_comdef_format(
499  $in_parent,
500  $s_array['shared_id_bigint'],
501  $s_array['format_type_string'],
502  $s_array['key_string'],
503  $s_array['icon_blob'],
504  $s_array['worldid_mixed'],
505  $s_array['lang_enum'],
506  $s_array['name_string'],
507  $s_array['description_string']
508  );
509  }
A Class for Format Codes.
UpdateToDB (   $is_rollback = false)

Updates the DB to the current values of this instance. (replacing current values of the DB).

Exceptions
aPDOException if there is a problem.

Set the values for this instance, to be stored in the database.

< This is used to keep track of the first iteration, to prevent a comma before it.

< This is the prepared statement value array.

Create a new entry.

We give the prepared statement a token, that will be filled by a value.

We give the value by declaring an associative array element with the token name.

Parameters
$is_rollbackIf true, this is a rollback operation.

Definition at line 67 of file c_comdef_format.class.php.

References $_COMDEF_DEBUG, $ret, c_comdef_server\AddNewChange(), each(), c_comdef_server\GetCurrentUserObj(), c_comdef_server\GetOneFormat(), and c_comdef_dbsingleton\preparedExec().

69  {
70  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
71  $ret = false;
72 
74 
75  if ($this->UserCanEdit($user)) {
76  // We take a snapshot of the format as it currently sits in the database as a "before" image.
77  $before = null;
78  $before_id = null;
79  $before_lang = null;
80  $before_obj = c_comdef_server::GetOneFormat($this->GetSharedID(), $this->GetLocalLang());
81 
82  if ($before_obj instanceof c_comdef_format) {
83  $before = $before_obj->SerializeObject();
84  $before_id = $before_obj->GetSharedID();
85  $before_lang = $before_obj->GetLocalLang();
86  $before_obj = null;
87  }
88 
89  try {
90  $this->DeleteFromDB_NoRecord();
91 
92  /// Set the values for this instance, to be stored in the database.
93  $record = array();
94  $record['shared_id_bigint'] = intval($this->GetSharedID());
95  $record['format_type_enum'] = $this->GetFormatType();
96  $record['key_string'] = $this->GetKey();
97  $record['icon_blob'] = $this->GetIcon();
98  $record['worldid_mixed'] = $this->GetWorldID();
99  $record['lang_enum'] = $this->GetLocalLang();
100  $record['name_string'] = $this->GetLocalName();
101  $record['description_string'] = $this->GetLocalDescription();
102 
103  $first = true; ///< This is used to keep track of the first iteration, to prevent a comma before it.
104  $vals = array(); ///< This is the prepared statement value array.
105 
106  /// Create a new entry.
107  $updateSQL = "INSERT INTO `".c_comdef_server::GetFormatTableName_obj()."` (";
108  while (list ( $key, $value ) = each($record)) {
109  if (!$first) {
110  $updateSQL .= ",";
111  } else {
112  $first = false;
113  }
114  $updateSQL .= "`".$key."`";
115  }
116 
117  reset($record);
118 
119  $updateSQL .= ") VALUES (";
120 
121  $first = true;
122  while (list ( $key, $value ) = each($record)) {
123  if (!$first) {
124  $updateSQL .= ",";
125  } else {
126  $first = false;
127  }
128  /// We give the prepared statement a token, that will be filled by a value.
129  $updateSQL .= ":$key";
130  /// We give the value by declaring an associative array element with the token name.
131  $vals[':'.$key] = $value;
132  }
133  $updateSQL .= ")";
134  c_comdef_dbsingleton::preparedExec($updateSQL, $vals);
135 
136  $after = $this->SerializeObject();
137  $after_id = $this->GetSharedID();
138  $after_lang = $this->GetLocalLang();
139 
140  $cType = (true == $is_rollback) ? 'comdef_change_type_rollback' : ((null != $before) ? 'comdef_change_type_change' : 'comdef_change_type_new');
141 
142  c_comdef_server::AddNewChange($user->GetID(), $cType, null, $before, $after, 'c_comdef_format', $before_id, $after_id, $before_lang, $after_lang);
143 
144  $ret = true;
145  } catch (Exception $ex) {
146  global $_COMDEF_DEBUG;
147 
148  if ($_COMDEF_DEBUG) {
149  echo "Exception Thrown in c_comdef_format::UpdateToDB()!<br />";
150  var_dump($ex);
151  }
152  throw ( $ex );
153  }
154  }
155 
156  return $ret;
157  }
GetLocalDescription()
Accessor -Returns a reference to the _local_type_desc_string data member.
static AddNewChange($in_user_id_bigint, $in_change_type, $in_service_body_id_bigint, $in_before_string, $in_after_string, $in_object_class_string, $in_before_obj_id_bigint, $in_after_obj_id_bigint, $in_before_obj_lang_enum=null, $in_after_obj_lang_enum=null, $in_name_string=null, $in_description_string=null, $in_lang_enum=null)
Creates a new change record in the Database.
GetSharedID()
Accessor -Get a reference to the shared ID.
static preparedExec($sql, $params=array())
Wrapper for preparing and executing a PDOStatement that does not return a resultset e...
GetLocalLang()
Returns a reference to the local language setting.
GetLocalName()
Accessor -Returns a reference to the _local_type_name_string data member.
$ret
Definition: contact.php:226
& GetFormatType()
Accessor -Returns a reference to the format type code.
UserCanEdit($in_user_object=null)
Test to see if a user is allowed to edit an instance (change the data).
& GetIcon()
Accessor -Returns a reference to the _icon_blob data member.
DeleteFromDB_NoRecord()
Deletes this instance from the database without recording it.
static GetOneFormat($in_id_bigint, $in_lang_enum)
Given an ID and a language for a format, it returns one instance.
A Class for Format Codes.
function E each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(e, t){n["[object "+t+"]"]=t.toLowerCase()})
& GetKey()
Accessor -Returns a reference to the _key_string data member.
SerializeObject()
Returns a storable serialization of the object, as a string.
global $_COMDEF_DEBUG
This flag, when set to true, will cause extra debug information to be output.
static GetCurrentUserObj($in_is_ajax=false)
Get the current logged-in user, as a c_comdef_user instance.
GetWorldID()
Accessor -Returns a reference to the _world_type_worldid_mixed data member.
UserCanEdit (   $in_user_object = null)

Test to see if a user is allowed to edit an instance (change the data).

Returns
true, if the user is allowed to edit, false, otherwise.
Parameters
$in_user_objectA reference to a c_comdef_user object, for the user to be validated. If null, or not supplied, the server current user is tested.

Implements i_comdef_auth.

Definition at line 517 of file c_comdef_format.class.php.

References $ret, c_comdef_server\GetCurrentUserObj(), and c_comdef_server\IsUserServerAdmin().

519  {
520  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
521  $ret = false;
522 
523  // We load the server user if one wasn't supplied.
524  if (null == $in_user_object) {
525  $in_user_object = c_comdef_server::GetCurrentUserObj();
526  }
527 
528  // If it isn't a user object, we fail right there.
529  if ($in_user_object instanceof c_comdef_user) {
530  $in_user_object->RestoreFromDB(); // The reason you do this, is to ensure that the user wasn't modified "live." It's a security precaution.
531  // Only the server admin can edit formats.
533  $ret = true;
534  }
535  }
536 
537  return $ret;
538  }
This class handles BMLT users. One instance is created for each user on the server.
$ret
Definition: contact.php:226
static GetCurrentUserObj($in_is_ajax=false)
Get the current logged-in user, as a c_comdef_user instance.
static IsUserServerAdmin($in_user_obj=null, $in_is_ajax=false)
Find out if the user is a server admin.

Member Data Documentation

$_format_codes = null

This will be an array of the format types (localized).

Definition at line 58 of file c_comdef_format.class.php.

$_format_type_string = null

This is the type of format.

  • An enumerated string value, representing the classification of the format:
    • "FC1" -Meeting Format (Speaker, Book Study, etc.)
    • "FC2" -Location Code (Wheelchair Accessible, Limited Parking, etc.)
    • "FC3" -Attendance Restriction (Men Only, Closed, Open, No Children, etc.)

Definition at line 49 of file c_comdef_format.class.php.

$_icon_blob = null

The Format Icon, as a 64-pixel-square Icon, in GIF format.

Definition at line 55 of file c_comdef_format.class.php.

$_key_string = null

The Format Key, in Text Form.

Definition at line 52 of file c_comdef_format.class.php.

$_shared_id_bigint = null

The shared ID (for multiple instances of the same format code).

Definition at line 42 of file c_comdef_format.class.php.


The documentation for this class was generated from the following file: