TABLE_PREFIX
TABLE_PREFIX
A prefix for all tables used by this plugin
saveOrUpdate(string $table, array $matchArray, array $input, array $format = null) : integer
Creates a new record unless doing so would create a duplicate, in which case, the existing record is updated
Returns the ID of the inserted or updated record
| string | $table | The database table into which the data should be saved |
| array | $matchArray | An array of key/value pairs that we will use to determine if this is an update or an insert |
| array | $input | An array of key/value pairs to save in the database |
| array | $format | An array of format specifiers for the update/insert |
getMeta(string $table, string $keyField, string $valueField, array $keyArray, $htmlEscape = false) : array
Gets a key/value pair array of meta_key/meta_values from the requested table
| string | $table | The database table from which the data should be read |
| string | $keyField | The name of the field holding the key |
| string | $valueField | The name of the field holding the values |
| array | $keyArray | An array of keys for which we hope to find values. This assumes only one result is ever received |
| $htmlEscape |
storeImageInfo(array $input, integer $parentId, boolean $removePreviousImage = false) : integer
Saves information about a newly added image to the database.
Returns the ID of the new or updated record
| array | $input | Input array of data to save |
| integer | $parentId | The ID of the image in the main table if this is a variation. 0 if this is a base image (not a variation) |
| boolean | $removePreviousImage | true to remove any previously recorded image of this type from the database and file system. Has no affect on image variations. Call removeImageVariations() for that. |
getImages(array $types, string $key, boolean $allowUnsaved) : array
Hub for retrieving urls to image variations
| array | $types | An array of images table image_type entries to get. The image_type value is the key of the returned array |
| string | $key | The meta_key of the variation to retrieve |
| boolean | $allowUnsaved | Set TRUE to have "unsaved" changes override the saved values where they exist |