DocumentCreator Class
This class is deprecated.
Creates structures for persistence and cleans various fields.
Item Index
Methods
accessFormatting
-
post
Formats access levels
Parameters:
-
post
ObjectKey value pair object
create
-
object_type
-
post
-
[csvItems]
-
[nullIfEmptyItems]
Creates a document object ready to be injected into the database
Parameters:
-
object_type
StringThe type of object to create
-
post
ObjectKey value pair object to prepare
-
[csvItems]
Array optionalKeys whose values are to be split from CSVs into arrays
-
[nullIfEmptyItems]
Array optionalKeys whose values are to be null if empty
Returns:
The database ready document object
csvItemsToArrays
-
post
-
csvItems
Splits CSV items into arrays
Parameters:
-
post
ObjectKey value pair object
-
csvItems
ArrayKeys whose values should be arrays
emailFormatting
-
post
Formats email fields
Parameters:
-
post
ObjectKey value pair object
emptyItemsToNull
-
post
-
nullIfEmptyItems
Formats empty items to null values
Parameters:
-
post
ObjectKey value pair object
-
nullIfEmptyItems
ArrayKeys whose values should be null if empty
formatIntegerItems
-
post
-
integerItems
Formats string items to integers
Parameters:
-
post
ObjectKey value pair object
-
integerItems
ArrayKeys whose values should be formatted as integers
passwordHash
-
post
Hashes all password fields
Parameters:
-
post
ObjectKey value pair object
update
-
post
-
existingObject
-
[csvItems]
-
[nullIfEmptyItems]
Updates a document object with new properties
Parameters:
-
post
ObjectKey value pairs to update with
-
existingObject
ObjectObject to update
-
[csvItems]
Array optionalKeys whose values are to be split from CSVs into arrays
-
[nullIfEmptyItems]
Array optionalKeys whose values are to be null if empty
Returns:
The database ready document object
usernameFormatting
-
post
Formats usernames
Parameters:
-
post
ObjectKey value pair object