Example #1
0
 /**
  * Selects case style for export.
  * This will determine the case style for the keys of exported beans (see exportAll).
  * The following options are accepted:
  *
  * 'default' RedBeanPHP by default enforces Snake Case (i.e. book_id is_valid )
  * 'camel'   Camel Case   (i.e. bookId isValid   )
  * 'dolphin' Dolphin Case (i.e. bookID isValid   ) Like CamelCase but ID is written all uppercase
  *
  * @warning RedBeanPHP transforms camelCase to snake_case using a slightly different
  * algorithm, it also converts isACL to is_acl (not is_a_c_l) and bookID to book_id.
  * Due to information loss this cannot be corrected. However if you might try
  * DolphinCase for IDs it takes into account the exception concerning IDs.
  *
  * @param string $caseStyle case style identifier
  *
  * @return void
  */
 public static function useExportCase($caseStyle = 'default')
 {
     if (!in_array($caseStyle, array('default', 'camel', 'dolphin'))) {
         throw new RedException('Invalid case selected.');
     }
     self::$exportCaseStyle = $caseStyle;
 }