setupAn optional hash array with the following possible setup keys:
loadMethodIf specified, it loads the Item from the database using the given method, from one of the following available loading methods:
fromIdLoads the item identified by the id given in the
fromDataLoads the item using the data passed in the
idThe id on the database of the item to load, when the
dataA hash array containing the data of the item to load, when the
loadMethodis specified, where each key is the field name, and its value the field value.
keyThe key of the data to get, matches the database field name.
keyexists in the item.
keyThe key of the data to check, matches the database field name.
trueif the key exists,
keyThe key of the data to set, matches the database field name.
fieldNamesAn optional array of field names that have been used to query items by index, so those queries will be cleared from cache.
idFieldNameand other field names commonly used by this object are automatically added to this array and cleared from cache.
idfrom the database.
methodThe loading method to use. If not specified, it uses the default Item::$loadFromIdMethod. One of the following values:
queryDatabaseCacheLoad the item from the database using cache.
queryDatabaseLoad the item from the database without using cache.
trueif the item was found and loaded successfully,
loadMethodhas been provided on construction. Intended to be overloaded when needed.
dataA hash array with the data. Default:
data, or with the data stored on the object if no
dataAn optional hash array where each key is the field name to update, and each value the new data to store on that field for this item. If not passed or left to false, the current data stored in the object is used. Default:
LANGUAGE_?constants and the value is the value in that language. If a non-array value is passed the currently detected language will be used.