Data writer for templates.

Data writers focus on writing a unit of data to the database, including verifying all data to the application rules (including those set by the owner) and doing denormalized updates as necessary.

The writer may also interact with the cache, if required.

package XenForo_Template

 Methods

Constructor.

__construct(\constant $errorHandler, array $inject) 
Inherited
inherited_from \XenForo_DataWriter::__construct()

Parameters

$errorHandler

\constant

Error handler. See {@link ERROR_EXCEPTION} and related.

$inject

arraynull

Dependency injector. Array keys available: db, cache.

Helper method to bulk set values from an array.

bulkSet(array $fields, array $options) 
Inherited
inherited_from \XenForo_DataWriter::bulkSet()

Parameters

$fields

array

Key-value pairs of fields and values.

$options

array

Options to pass into {@link set()}. See {@link $_setOptions}.

Factory method to get the named data writer.

create(string $class, \constant $errorHandler, array $inject) : \XenForo_DataWriter
InheritedStatic

The class must exist or be autoloadable or an exception will be thrown.

inherited_from \XenForo_DataWriter::create()

Parameters

$class

string

Class to load

$errorHandler

\constant

Error handler. See {@link ERROR_EXCEPTION} and related.

$inject

arraynull

Dependencies to inject. See {@link __construct()}.

Returns

Deletes the record that was selected by a call to {@link setExistingData()}.

delete() : boolean
Inherited
inherited_from \XenForo_DataWriter::delete()

Returns

booleanTrue on success

Trigger an error with the specified string (or phrase object).

error(string | \XenForo_Phrase $error, string | false $errorKey, boolean $specificError) 
Inherited

Depending on the type of error handler chosen, this may throw an exception.

inherited_from \XenForo_DataWriter::error()

Parameters

$error

string\XenForo_Phrase

Error message

$errorKey

stringfalse

Unique key for the error. Used to prevent multiple errors from the same field being displayed.

$specificError

boolean

If true and error key specified, overwrites an existing error with this name

Gets data related to this object regardless of where it is defined (new or old).

get(string $field, string $tableName) : mixed
Inherited
inherited_from \XenForo_DataWriter::get()

Parameters

$field

string

Field name

$tableName

string

Table name, if empty loops through tables until first match

Returns

mixedReturns null if the specified field could not be found.

Gets the specific named error if reported.

getError(string $errorKey) : string
Inherited
inherited_from \XenForo_DataWriter::getError()

Parameters

$errorKey

string

Returns

string

Gets all errors that have been triggered.

getErrors() : array
Inherited

If preSave() has been called and this returns an empty array, a save() should go through.

inherited_from \XenForo_DataWriter::getErrors()

Returns

array

Explictly gets data from the existing data array.

getExisting(string $field, string $tableName) : mixed
Inherited

Returns null if not set.

inherited_from \XenForo_DataWriter::getExisting()

Parameters

$field

string

Field name

$tableName

string

Table name, if empty loops through tables until first match

Returns

mixed

Gets the named piece of extra data.

getExtraData(string $name) : mixed
Inherited
inherited_from \XenForo_DataWriter::getExtraData()

Parameters

$name

string

Returns

mixed

getFieldNames()

getFieldNames($tableName) 
Inherited
inherited_from \XenForo_DataWriter::getFieldNames()

Parameters

$tableName

Merges the new and existing data to show a "final" view of the data.

getMergedData(string $tableName) : array
Inherited

This will generally reflect what is in the database.

If no table is specified, all data will be flattened into one array. New data takes priority over existing data, and earlier tables in the list take priority over later tables.

inherited_from \XenForo_DataWriter::getMergedData()

Parameters

$tableName

string

Returns

array

Gets the existing data only into a flat view of the data.

getMergedExistingData(string $tableName) : array
Inherited
inherited_from \XenForo_DataWriter::getMergedExistingData()

Parameters

$tableName

string

Returns

array

Gets all new data that has been set to date, merged through all tables.

getMergedNewData(string $tableName) 
Inherited
inherited_from \XenForo_DataWriter::getMergedNewData()

Parameters

$tableName

string

Gets the specified model object from the cache.

getModelFromCache(string $class) : \XenForo_Model
Inherited

If it does not exist, it will be instantiated.

inherited_from \XenForo_DataWriter::getModelFromCache()

Parameters

$class

string

Name of the class to load

Returns

Explictly gets data from the new data array.

getNew(string $field, string $tableName) : mixed
Inherited

Returns null if not set.

inherited_from \XenForo_DataWriter::getNew()

Parameters

$field

string

Field name

$tableName

string

Table name, if empty loops through tables until first match

Returns

mixed

Gets all new data that has been set to date

getNewData() : array
Inherited
inherited_from \XenForo_DataWriter::getNewData()

Returns

array

Gets an option.

getOption(string $name) : mixed
Inherited

The meaning of this option is completely domain specific. If an unknown option specified, an exception will be triggered.

inherited_from \XenForo_DataWriter::getOption()

Parameters

$name

string

Name of the option to get

Returns

mixedValue of the option

Splits a (complete) data record array into its constituent tables using the _fields array for use in _getExistingData

getTablesDataFromArray(array $dataArray) : array
Inherited

In order for this to work, the following must be true: 1) The input array must provide all data that this datawriter requires 2) There can be no overlapping field names in the tables that define this data, unless those fields all store the same value 3) IMPORTANT: If the input array does not include all the required data fields, it is your responsibility to provide it after this function returns.

inherited_from \XenForo_DataWriter::getTablesDataFromArray()

Parameters

$dataArray

array

Complete data record

Returns

array

External handler to get the SQL update/delete condition for this data.

getUpdateCondition(string $tableName) : string
Inherited

If there is no existing data, this always returns an empty string, otherwise it proxies to _getUpdateCondition(), which is an abstract function.

inherited_from \XenForo_DataWriter::getUpdateCondition()

Parameters

$tableName

string

Name of the table to fetch the condition for

Returns

string

Returns true if changes have been made to this data.

hasChanges() : boolean
Inherited
inherited_from \XenForo_DataWriter::hasChanges()

Returns

boolean

Determines if this DW has errors.

hasErrors() : boolean
Inherited
inherited_from \XenForo_DataWriter::hasErrors()

Returns

boolean

Determines whether the named field has been changed/set.

isChanged(string $field, string $tableName) : boolean
Inherited
inherited_from \XenForo_DataWriter::isChanged()

Parameters

$field

string

Field name

$tableName

string

Table name, if empty loops through tables until first match

Returns

boolean

Determines whether or not the specified extra data field has been set at all

isExtraDataSet(string $name) : boolean
Inherited
inherited_from \XenForo_DataWriter::isExtraDataSet()

Parameters

$name

string

Returns

boolean

Returns true if this DW is inserting a record, rather than updating one.

isInsert() : boolean
Inherited
inherited_from \XenForo_DataWriter::isInsert()

Returns

boolean

Returns true if this DW is updating a record, rather than inserting one.

isUpdate() : boolean
Inherited
inherited_from \XenForo_DataWriter::isUpdate()

Returns

boolean

Merges a set of errors into this DW.

mergeErrors(array $errors) 
Inherited
inherited_from \XenForo_DataWriter::mergeErrors()

Parameters

$errors

array

Public facing handler for final verification before a delete.

preDelete() 
Inherited

Any verification or complex defaults may be set by this.

It is generally not advisable to override this function. If you just want to add pre-delete behaviors, override _preDelete().

inherited_from \XenForo_DataWriter::preDelete()

Public facing handler for final verification before a save.

preSave() 
Inherited

Any verification or complex defaults may be set by this.

It is generally not advisable to override this function. If you just want to add pre-save behaviors, override _preSave().

inherited_from \XenForo_DataWriter::preSave()

Saves the changes to the data.

save() : boolean
Inherited

This either updates an existing record or inserts a new one, depending whether setExistingData was called.

After a successful insert with an auto_increment field, the value will be stored into the new data array with a field marked as autoIncrement. Use get() to get access to it.

inherited_from \XenForo_DataWriter::save()

Returns

booleanTrue on success

Sets a field.

set(string $field, string $value, string $tableName, array $options) : boolean
Inherited

This value will be updated when save is called.

inherited_from \XenForo_DataWriter::set()

Parameters

$field

string

Name of field to update

$value

string

Value to update with

$tableName

string

Table name, if empty then all tables with that column

$options

array

Options. See {@link $_setOptions).

Returns

boolean

Sets the default options for {@link set()}.

setDefaultSetOptions(array $setOptions) 
Inherited

See $_setOptions for the available options.

inherited_from \XenForo_DataWriter::setDefaultSetOptions()

Parameters

$setOptions

array

Sets the error handler type.

setErrorHandler(integer $errorHandler) 
Inherited
inherited_from \XenForo_DataWriter::setErrorHandler()

Parameters

$errorHandler

integer

Sets the existing data.

setExistingData(mixed $data, boolean $trustInputAsPrimary) : boolean
Inherited

This causes the system to do an update instead of an insert. This function triggers an error if no data can be fetched from the provided data.

inherited_from \XenForo_DataWriter::setExistingData()

Parameters

$data

mixed

Data that can uniquely ID this item

$trustInputAsPrimary

boolean

If true, trust the passed data to be based on data in DB; if false, the data is used as is (if it's an array)

Returns

boolean

Sets extra data that the DW can use to help it.

setExtraData(string $name, mixed $value) 
Inherited

The DW should be able to function without this data.

inherited_from \XenForo_DataWriter::setExtraData()

Parameters

$name

string

Name of the data

$value

mixed

Value of the data

Sets the import mode.

setImportMode(\boolean$mode $mode) 
Inherited

When enabled, preSave, postSave, and verification functions are disabled.

inherited_from \XenForo_DataWriter::setImportMode()

Parameters

$mode

\boolean$mode

Sets an option.

setOption(string $name, mixed $value) 
Inherited

The meaning of this option is completely domain specific. If an unknown option specified, an exception will be triggered.

inherited_from \XenForo_DataWriter::setOption()

Parameters

$name

string

Name of the option to set

$value

mixed

Value of the option

Updates the version ID field for the specified record.

updateVersionId(string $versionIdField, string $versionStringField, string $addOnIdField) : integer
Inherited

Th add-on ID is determined from a previously set value, so it should not be updated after this is called.

inherited_from \XenForo_DataWriter::updateVersionId()

Parameters

$versionIdField

string

Name of the field the version ID will be written to

$versionStringField

string

Name of the field where the version string will be written to

$addOnIdField

string

Name of the field the add-on ID is kept in

Returns

integerVersion ID to use

Applies value limits to a field based on type and other constraints.

_applyFieldValueLimits(string $fieldType, mixed $value, array $extraLimits) : boolean | string
Inherited

Returns true if the field meets the constraints. The passed in value will be modified by reference.

inherited_from \XenForo_DataWriter::_applyFieldValueLimits()

Parameters

$fieldType

string

Type of the field. See the TYPE_* constants.

$value

mixed

Value for the field.

$extraLimits

array

Extra constraints

Returns

booleanstringEither TRUE or an error message

Starts a new database transaction.

_beginDbTransaction() 
Inherited
inherited_from \XenForo_DataWriter::_beginDbTransaction()

Casts the field value based on the specified type (TYPE_* constants).

_castValueToType(string $fieldType, mixed $value, string $fieldName, array $fieldData) : mixed
Inherited
inherited_from \XenForo_DataWriter::_castValueToType()

Parameters

$fieldType

string

Type to cast to

$value

mixed

Value to cast

$fieldName

string

Name of the field being cast

$fieldData

array

Array of all field data information, for extra options

Returns

mixed

Checks that required field values are still maintained on updates.

_checkRequiredFieldsForUpdate() 
Inherited
inherited_from \XenForo_DataWriter::_checkRequiredFieldsForUpdate()

Commits a new database transaction.

_commitDbTransaction() 
Inherited
inherited_from \XenForo_DataWriter::_commitDbTransaction()

Internal handler for a delete action.

_delete() 
Inherited

Actually does the delete.

inherited_from \XenForo_DataWriter::_delete()

Deletes the corresponding file when a template is deleted from the database

_deleteExistingDevFile(string $dir) 

Parameters

$dir

string

Path to admin templates directory

Deletes mapped data (template map entries, includes, compiled info) and determines what templates (if any need to be recompiled).

_deleteMappedData() : true | false | array

A deletion can be a "revert" or it can actually remove a template from the hierarchy.

Returns

truefalsearrayIf true, recompile this template and includes; if array, recompile specified map IDs; else, no recompile

Deletes the named master phrase if it exists.

_deleteMasterPhrase(string $title) 
Inherited
inherited_from \XenForo_DataWriter::_deleteMasterPhrase()

Parameters

$title

string

Returns the admin search model

_getAdminSearchModel() : \XenForo_Model_AdminSearch
Inherited
inherited_from \XenForo_DataWriter::_getAdminSearchModel()

Returns

Returns the alert model

_getAlertModel() : \XenForo_Model_Alert
Inherited
inherited_from \XenForo_DataWriter::_getAlertModel()

Returns

Finds the auto-increment field in the list of fields.

_getAutoIncrementField(string $tableName) : string | false
Inherited

This field is simply the first field tagged with the autoIncrement flag.

inherited_from \XenForo_DataWriter::_getAutoIncrementField()

Parameters

$tableName

string

Name of the table to obtain the field for

Returns

stringfalseName of the field if found or false

Helper method to get the cache object.

_getCache() : \Zend_Cache_Core | \Zend_Cache_Frontend | false
Inherited
inherited_from \XenForo_DataWriter::_getCache()

Returns

\Zend_Cache_Core\Zend_Cache_Frontendfalse

Gets the default set of options for this data writer.

_getDefaultOptions() : array

If in debug mode and we have a development directory config, we set the template dev output directory automatically.

Returns

array

Helper to get the developer data output directory only if it is enabled and applicable to this situation.

_getDevOutputDir() : string

Returns

string

Gets the actual existing data out of data that was passed in.

_getExistingData(mixed $data) : array | false

See parent for explanation.

Parameters

$data

mixed

Returns

arrayfalse

Get the primary key from either an array of data or just the scalar value

_getExistingPrimaryKey(mixed $data, string $primaryKeyField, string $tableName) : string | false
Inherited
inherited_from \XenForo_DataWriter::_getExistingPrimaryKey()

Parameters

$data

mixed

Array of data containing the primary field or a scalar ID

$primaryKeyField

string

Primary key field, if data is an array

$tableName

string

Table name, if empty the first table defined in fields is used

Returns

stringfalse

Gets the fields that are defined for the table.

_getFields() : array

See parent for explanation.

Returns

array

Returns the news feed model

_getNewsFeedModel() : \XenForo_Model_NewsFeed
Inherited
inherited_from \XenForo_DataWriter::_getNewsFeedModel()

Returns

Returns the phrase model

_getPhraseModel() : \XenForo_Model_Phrase
Inherited
inherited_from \XenForo_DataWriter::_getPhraseModel()

Returns

Finds the first table in the _fields array

_getPrimaryTable() : string | false
Inherited
inherited_from \XenForo_DataWriter::_getPrimaryTable()

Returns

stringfalseName of the table or false

Gets the error text (or phrase) for a specific required field.

_getSpecificRequiredFieldErrorText(string $tableName, string $field) : false | string | \XenForo_Phrase
Inherited

Concrete DWs may override this to get nicer error messages for specific fields.

inherited_from \XenForo_DataWriter::_getSpecificRequiredFieldErrorText()

Parameters

$tableName

string

$field

string

Returns

falsestring\XenForo_Phrase

Gets an array with a list of all table names or, if provided, only the specified table.

_getTableList(string $tableName) : array
Inherited
inherited_from \XenForo_DataWriter::_getTableList()

Parameters

$tableName

string

Optional table to limit results to.

Returns

array

Gets the template model object.

_getTemplateModel() : \XenForo_Model_Template

Gets SQL condition to update the existing record.

_getUpdateCondition(string $tableName) : string

Should read from _existingData.

Parameters

$tableName

string

Table name

Returns

string

_getUserIgnoreModel()

_getUserIgnoreModel() : \XenForo_Model_UserIgnore
Inherited
inherited_from \XenForo_DataWriter::_getUserIgnoreModel()

Returns

Returns the user model

_getUserModel() : \XenForo_Model_User
Inherited
inherited_from \XenForo_DataWriter::_getUserModel()

Returns

Determines if we have errors that would prevent a save.

_haveErrorsPreventSave() : boolean
Inherited

If the silent error handler is used, errors simply trigger a return of true (yes, we have errors); otherwise, errors trigger an exception. Generally, if errors are to be handled, save shouldn't be called.

inherited_from \XenForo_DataWriter::_haveErrorsPreventSave()

Returns

booleanTrue if there are errors

Internal save handler.

_insert() 
Inherited
inherited_from \XenForo_DataWriter::_insert()

Inserts or updates a master (language 0) phrase.

_insertOrUpdateMasterPhrase(string $title, string $text, string $addOnId, array $extra) 
Inherited

Errors will be silently ignored.

inherited_from \XenForo_DataWriter::_insertOrUpdateMasterPhrase()

Parameters

$title

string

$text

string

$addOnId

string

$extra

array

Determines if the provided value for a field is valid.

_isFieldValueValid(string $fieldName, array $fieldData, mixed $value, array $options) : boolean
Inherited

The value may be modified based on type, contraints, or other verification methods.

inherited_from \XenForo_DataWriter::_isFieldValueValid()

Parameters

$fieldName

string

Name of the field.

$fieldData

array

Data about the field (includes type, contraints, callback, etc)

$value

mixed

Value for the field

$options

array

Options. Uses {@link $_setOptions}.

Returns

boolean

Performs a language rebuild if needed.

_performLanguageRebuild() 
Inherited
inherited_from \XenForo_DataWriter::_performLanguageRebuild()

Post-delete handler.

_postDelete() 

Post-save handler.

_postSave() 

This is not called in import mode.

Method designed to be overridden by child classes to add post-save behaviors that should be run after the transaction is committed.

_postSaveAfterTransaction() 
Inherited

This is not called in import mode.

inherited_from \XenForo_DataWriter::_postSaveAfterTransaction()

Method designed to be overridden by child classes to add pre-delete behaviors.

_preDelete() 
Inherited
inherited_from \XenForo_DataWriter::_preDelete()

Verifies that the specified title is not a duplicate

_preSave() 

This is not callbed in import mode.

Method designed to be overridden by child classes to add pre-save behaviors that set dynamic defaults.

_preSaveDefaults() 
Inherited

This is still called in import mode.

inherited_from \XenForo_DataWriter::_preSaveDefaults()

Recompiles the changed template and any templates that include it.

_recompileTemplate() 

Renames a master phrase.

_renameMasterPhrase(string $oldName, string $newName) 
Inherited

If you get a conflict, it will be silently ignored.

inherited_from \XenForo_DataWriter::_renameMasterPhrase()

Parameters

$oldName

string

$newName

string

This resolves unset fields to their defaults (if available) and the checks for required fields that are unset or empty.

_resolveDefaultsAndRequiredFieldsForInsert(boolean $checkRequired) 
Inherited

If a required field is not set properly, an error is thrown.

inherited_from \XenForo_DataWriter::_resolveDefaultsAndRequiredFieldsForInsert()

Parameters

$checkRequired

boolean

If true, checks required fields

Rolls a database transaction back.

_rollbackDbTransaction() 
Inherited
inherited_from \XenForo_DataWriter::_rollbackDbTransaction()

Runs the verification callback.

_runVerificationCallback(callback $callback, mixed $value, array $fieldData, $fieldName) : boolean
Inherited

This callback may modify the value if it chooses to. Callback receives 2 params: the value and this object. The callback must return true if the value was valid.

Returns true if the verification was successful.

inherited_from \XenForo_DataWriter::_runVerificationCallback()

Parameters

$callback

callback

Callback to run. Use an array with a string '$this' to callback to this object.

$value

mixed

Value to verify

$fieldData

array

Information about the field, including all constraints to be applied

$fieldName

Returns

boolean

Internal save handler.

_save() 
Inherited

Deals with both updates and inserts.

inherited_from \XenForo_DataWriter::_save()

Sets the auto-increment value to the auto increment field, if there is one.

_setAutoIncrementValue(integer $insertId, string $tableName, bool $updateAll) : boolean
Inherited

If the ID passed in is 0, nothing will be updated.

inherited_from \XenForo_DataWriter::_setAutoIncrementValue()

Parameters

$insertId

integer

Auto-increment value from 0.

$tableName

string

Name of the table set the auto increment field in

$updateAll

bool

Update all tables with cross referenced auto increment fields

Returns

booleanTrue on update

Internal function to set a field without any validation or type casting.

_setInternal(string $table, string $field, mixed $newValue, boolean $forceSet) 
Inherited

Use only when you're sure validation, etc isn't needed. The field will only be set if the value has changed.

inherited_from \XenForo_DataWriter::_setInternal()

Parameters

$table

string

Table the field belongs to

$field

string

Name of the field

$newValue

mixed

Value for the field

$forceSet

boolean

If true, the set always goes through

Internal helper for calling set after save and not triggering an error.

_setPostSave(string $field, string $newValue, string $tableName, array $options) : boolean
Inherited
inherited_from \XenForo_DataWriter::_setPostSave()

Parameters

$field

string

Name of field to update

$newValue

string

Value to update with

$tableName

string

Table name, if empty then all tables with that column

$options

array

Options. See {@link $_setOptions).

Returns

boolean

Triggers the error for when invalid existing data was requested.

_triggerInvalidExistingDataError() 
Inherited

This can (and generally should) be extended by concrete DWs to give an error that is more specific to their content type.

inherited_from \XenForo_DataWriter::_triggerInvalidExistingDataError()

Triggers the error for a required field not being specified.

_triggerRequiredFieldError(string $tableName, string $field) 
Inherited
inherited_from \XenForo_DataWriter::_triggerRequiredFieldError()

Parameters

$tableName

string

$field

string

Internal update handler.

_update() 
Inherited
inherited_from \XenForo_DataWriter::_update()

Verification callback to prepare a template.

_verifyPrepareTemplate(string $template) : true

This isn't actually a verifier; it just automatically compiles the template.

Parameters

$template

string

Uncompiled template

Returns

true

Verifies that the provided template title contains only valid characters

_verifyPrepareTitle(string $title) : boolean

Parameters

$title

string

Title

Returns

boolean

Writes the development file output to the specified directory.

_writeDevFileOutput(string $dir) 

This will write each template into an individual file for easier tracking in source control.

Parameters

$dir

string

Path to directory to write to

_writeMetaDataDevFileOutput()

_writeMetaDataDevFileOutput($dir, $title, $data) 

Parameters

$dir

$title

$data

 Properties

 

$_cache : \Zend_Cache_Core | \Zend_Cache_Frontend
Inherited
inherited_from \XenForo_DataWriter::$$_cache
 

$_db : \Zend_Db_Adapter_Abstract
Inherited
inherited_from \XenForo_DataWriter::$$_db
 

$_errorHandler : integer
Inherited

See ERROR_EXCEPTION and related.

inherited_from \XenForo_DataWriter::$$_errorHandler
 

$_errors : array
Inherited

This is always populated when an error occurs, though an exception may be thrown as well.

inherited_from \XenForo_DataWriter::$$_errors
 

$_existingData : array
Inherited

This is only populated when updating a record.

inherited_from \XenForo_DataWriter::$$_existingData
 

$_existingDataErrorPhrase : string
 

$_extraData : array
Inherited

The DW should usually function without any data in this array. Any data that DW supports should be documented in this array, preferably by the use of constants.

Required data (for example, a related phrase) can be included here if necessary.

inherited_from \XenForo_DataWriter::$$_extraData
 

$_fields : array
Inherited

See _getFields() for more info.

inherited_from \XenForo_DataWriter::$$_fields
 

$_importMode : boolean
Inherited

To be used when using the DW for importing data in bulk. Note that you are responsible for manually replicating the post save effects.

inherited_from \XenForo_DataWriter::$$_importMode
 

$_modelCache : array
Inherited

This is now a static cache to allow data to be reused between data writers, as they are often used in bulk.

inherited_from \XenForo_DataWriter::$$_modelCache
 

$_newData : array
Inherited
inherited_from \XenForo_DataWriter::$$_newData
 

$_options : array
Inherited

All options that a data writer supports must be documented in this array, preferably by the use of constants.

inherited_from \XenForo_DataWriter::$$_options
 

$_preDeleteCalled : boolean
Inherited

It can only be called once.

inherited_from \XenForo_DataWriter::$$_preDeleteCalled
 

$_preSaveCalled : boolean
Inherited

It can only be called once.

inherited_from \XenForo_DataWriter::$$_preSaveCalled
 

$_setOptions : array
Inherited

Available options are: (default value is listed in parentheses) * ignoreInvalidFields (false) - when true, an invalid field is simply ignored; otherwise an error is triggered * replaceInvalidWithDefault (false) - when true, invalid values are replaced with the default value (if there is one) * runVerificationCallback (true) - when true, verification callbacks are run when setting * setAfterPreSave (false) - when true, you may set data after preSave is called. This has very specific uses.

inherited_from \XenForo_DataWriter::$$_setOptions
 

$_triggerLanguageRebuild : boolean
Inherited
inherited_from \XenForo_DataWriter::$$_triggerLanguageRebuild

 Constants

 

Constant for error handling.

ERROR_ARRAY : integer
Inherited

Use this to push errors onto an array. If you try to save while there are errors, an exception will be thrown.

inherited_from \XenForo_DataWriter::ERROR_ARRAY
 

Constant for error handling.

ERROR_EXCEPTION : integer
Inherited

Use this to trigger an exception when an error occurs.

inherited_from \XenForo_DataWriter::ERROR_EXCEPTION
 

Constant for error handling.

ERROR_SILENT : integer
Inherited

Use this to push errors onto an array. If you try to save while there are errors, the save will silently fail. Use this in places where you aren't interested in handling errors.

inherited_from \XenForo_DataWriter::ERROR_SILENT
 

If false, duplicate checking is disabled.

OPTION_CHECK_DUPLICATE : string

An error will occur on dupes. Defaults to true.

 

Option that takes the path to the development template output directory.

OPTION_DEV_OUTPUT_DIR : string

If not specified, output will not be written. Defaults determined based on config settings.

 

Option that controls whether a full compile is performed when the template is modified.

OPTION_FULL_COMPILE : string

If false, the template is only parsed into segments. Defaults to true, but should be set to false for bulk imports; compilation should happen in the second pass.

 

Option that controls if template map is rebuild when template is changed.

OPTION_REBUILD_TEMPLATE_MAP : string

Defaults to true.

 

Option that controls whether a test compile will be performed when setting the value of a template.

OPTION_TEST_COMPILE : string

If false, the error will only be detected when a full compile is done.

Note that this does not prevent the template from being parsed. That will always happen.

 

Constant for data fields.

TYPE_BINARY : string
Inherited

Use this for binary or ASCII-only fields. Limits will refer to bytes.

inherited_from \XenForo_DataWriter::TYPE_BINARY
 

Constant for data fields.

TYPE_BOOLEAN : string
Inherited

Use this for 0/1 boolean integer fields.

inherited_from \XenForo_DataWriter::TYPE_BOOLEAN
 

Constant for data fields.

TYPE_FLOAT : string
Inherited

Use this for float fields. Limits can be applied on the range of valid values.

inherited_from \XenForo_DataWriter::TYPE_FLOAT
 

Constant for data fields.

TYPE_INT : string
Inherited

Use this for integer fields. Limits can be applied on the range of valid values.

inherited_from \XenForo_DataWriter::TYPE_INT
 

Data is serialized to JSON.

TYPE_JSON : string
Inherited
inherited_from \XenForo_DataWriter::TYPE_JSON
 

Data is serialized.

TYPE_SERIALIZED : string
Inherited

Ensures that if the data is not a string, it is serialized to ne.

inherited_from \XenForo_DataWriter::TYPE_SERIALIZED
 

Constant for data fields.

TYPE_STRING : string
Inherited

Use this for string fields. String fields are assumed to be UTF-8 and limits will refer to characters.

inherited_from \XenForo_DataWriter::TYPE_STRING
 

Constant for data fields.

TYPE_UINT : string
Inherited

Use this for unsigned integer fields. Negative values will always fail to be valid. Limits can be applied on the range of valid values.

inherited_from \XenForo_DataWriter::TYPE_UINT
 

Constant for data fields.

TYPE_UINT_FORCED : string
Inherited

Use this for unsigned integer fields. This differs from TYPE_UINT in that negative values will be silently cast to 0. Limits can be applied on the range of valid values.

inherited_from \XenForo_DataWriter::TYPE_UINT_FORCED
 

Constant for data fields.

TYPE_UNKNOWN : string
Inherited

Use this for fields that have a type that cannot be known statically. Use this sparingly, as you must write code to ensure that the value is a scalar before it is inserted into the DB. The behavior if you don't do this is not defined!

inherited_from \XenForo_DataWriter::TYPE_UNKNOWN