Data writer for Feeds.

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_Feed

 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
Inherited

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($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 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
Inherited

This is automatically called in the constructor. If you wish to set options in your data writer, override this function. As this is handled at run time rather than compile time, you may use dynamic behaviors to set the option defaults.

inherited_from \XenForo_DataWriter::_getDefaultOptions()

Returns

array

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

_getExistingData(mixed $data) : array | false

This data may be a scalar or an array. If it's a scalar, assume that it is the primary key (if there is one); if it is an array, attempt to extract the primary key (or some other unique identifier). Then fetch the correct data from a model.

see \global\XenForo_DataWriter::_getExistingData()

Parameters

$data

mixed

Data that can uniquely ID this item

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

_getFeedModel()

_getFeedModel() : \XenForo_Model_Feed

Returns all xf_feed fields

_getFields() : array

This should return an array with each key being a table name and a further array with each key being a field in database. The value of each entry should be an array, which may have the following keys: * type - one of the TYPE_* constants, this controls the type of data in the field * autoIncrement - set to true when the field is an auto_increment field. Used to populate this field after an insert * required - if set, inserts will be prevented if this field is not set or an empty string (0 is accepted) * requiredError - the phrase title that should be used if the field is not set (only if required) * default - the default value of the field; used if the field isn't set or if the set value is outside the constraints (if a $_setOption is set) * maxLength - for string/binary types only, the maximum length of the data. For strings, in characters; for binary, in bytes. * min - for numeric types only, the minimum value allowed (inclusive) * max - for numeric types only, the maximum value allowed (inclusive) * allowedValues - an array of allowed values for this field (commonly for enums) * verification - a callback to do more advanced verification. Callback function will take params for $value and $this.

see \global\XenForo_DataWriter::_getFields()

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 SQL condition to update the existing record.

_getUpdateCondition(string $tableName) : string

Should read from _existingData.

see \global\XenForo_DataWriter::_getUpdateCondition()

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()

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

_postDelete() 

Method designed to be overridden by child classes to add post-save behaviors.

_postSave() 
Inherited

This is not called in import mode.

inherited_from \XenForo_DataWriter::_postSave()

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()

Fill in the title field if it's not been set

_preSave() 

This is not callbed in import mode.

see \global\XenForo_DataWriter::_preSave()

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()

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()

_verifyForum()

_verifyForum($nodeId) 

Parameters

$nodeId

 Properties

 

Cache object

$_cache : \Zend_Cache_Core | \Zend_Cache_Frontend
Inherited

inherited_from \XenForo_DataWriter::$$_cache
 

Database object

$_db : \Zend_Db_Adapter_Abstract
Inherited

inherited_from \XenForo_DataWriter::$$_db
 

Type of error handler.

$_errorHandler : integer
Inherited

See ERROR_EXCEPTION and related.

inherited_from \XenForo_DataWriter::$$_errorHandler
 

Array of errors.

$_errors : array
Inherited

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

inherited_from \XenForo_DataWriter::$$_errors
 

Existing data in the database.

$_existingData : array
Inherited

This is only populated when updating a record.

inherited_from \XenForo_DataWriter::$$_existingData
 

Title of the phrase that will be created when a call to set the existing data fails (when the data doesn't exist).

$_existingDataErrorPhrase : string
Inherited

inherited_from \XenForo_DataWriter::$$_existingDataErrorPhrase
 

Extra data that the data writer can use.

$_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
 

Array of valid fields in the table.

$_fields : array
Inherited

See _getFields() for more info.

inherited_from \XenForo_DataWriter::$$_fields
 

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

$_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
 

Standard approach to caching model objects for the lifetime of the data writer.

$_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
 

Data that has just been set an is about to be saved.

$_newData : array
Inherited

inherited_from \XenForo_DataWriter::$$_newData
 

Options that change the behavior of the data writer.

$_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
 

Tracks whether {@link _preDelete()} was called.

$_preDeleteCalled : boolean
Inherited

It can only be called once.

inherited_from \XenForo_DataWriter::$$_preDeleteCalled
 

Tracks whether {@link _preSave()} was called.

$_preSaveCalled : boolean
Inherited

It can only be called once.

inherited_from \XenForo_DataWriter::$$_preSaveCalled
 

Options that can be passed into {@link set()}.

$_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
 

If true, a language rebuild is triggered at the very end of a save/delete process.

$_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
 

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