class Transformations

Transformations class

Methods

array
getOptions(string $option_string)

Returns array of options from string with options separated by comma, removes quotes

array
getAvailableMimeTypes()

Gets all available MIME-types

string
getClassName(string $filename)

Returns the class name of the transformation

string
getDescription(string $file)

Returns the description of the transformation

string
getName(string $file)

Returns the name of the transformation

string
fixUpMime(string $value)

Fixups old MIME or transformation name to new one

array|bool
getMime(string $db, string $table, boolean $strict = false, boolean $fullName = false)

Gets the mimetypes for all columns of a table

boolean
setMime(string $db, string $table, string $key, string $mimetype, string $transformation, string $transformationOpts, string $inputTransform, string $inputTransformOpts, boolean $forcedelete = false)

Set a single mimetype to a certain value.

boolean
clear(string $db, string $table = '', string $column = '')

Delete related transformation details after deleting database. table or column

Details

at line 52
array getOptions(string $option_string)

Returns array of options from string with options separated by comma, removes quotes

getOptions("'option ,, quoted',abd,'2,3',"); // array { // 'option ,, quoted', // 'abc', // '2,3', // '', // }

Parameters

string $option_string comma separated options

Return Value

array options

at line 98
array getAvailableMimeTypes()

Gets all available MIME-types

Return Value

array array[mimetype], array[transformation]

at line 173
string getClassName(string $filename)

Returns the class name of the transformation

Parameters

string $filename transformation file name

Return Value

string the class name of transformation

at line 189
string getDescription(string $file)

Returns the description of the transformation

Parameters

string $file transformation file

Return Value

string the description of the transformation

at line 207
string getName(string $file)

Returns the name of the transformation

Parameters

string $file transformation file

Return Value

string the name of the transformation

at line 230
string fixUpMime(string $value)

Fixups old MIME or transformation name to new one

  • applies some hardcoded fixups
  • adds spaces after _ and numbers
  • capitalizes words
  • removes back spaces

Parameters

string $value Value to fixup

Return Value

string

at line 264
array|bool getMime(string $db, string $table, boolean $strict = false, boolean $fullName = false)

Gets the mimetypes for all columns of a table

Parameters

string $db the name of the db to check for
string $table the name of the table to check for
boolean $strict whether to include only results having a mimetype set
boolean $fullName whether to use full column names as the key

Return Value

array|bool [field_name][field_key] = field_value

at line 342
boolean setMime(string $db, string $table, string $key, string $mimetype, string $transformation, string $transformationOpts, string $inputTransform, string $inputTransformOpts, boolean $forcedelete = false)

Set a single mimetype to a certain value.

Parameters

string $db the name of the db
string $table the name of the table
string $key the name of the column
string $mimetype the mimetype of the column
string $transformation the transformation of the column
string $transformationOpts the transformation options of the column
string $inputTransform the input transformation of the column
string $inputTransformOpts the input transformation options of the column
boolean $forcedelete force delete, will erase any existing comments for this column

Return Value

boolean true, if comment-query was made.

at line 458
boolean clear(string $db, string $table = '', string $column = '')

Delete related transformation details after deleting database. table or column

Parameters

string $db Database name
string $table Table name
string $column Column name

Return Value

boolean State of the query execution