v5:reference:connection:setcustommetatype
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
v5:reference:connection:setcustommetatype [2021/01/06 02:37] – mnewnham | v5:reference:connection:setcustommetatype [2021/01/17 04:17] – mnewnham | ||
---|---|---|---|
Line 9: | Line 9: | ||
| | ||
| | ||
- | mixed $handler | + | string $dictionayType, |
+ | mixed $handleAsType=false, | ||
+ | mixed $callBack=false | ||
) | ) | ||
</ | </ | ||
Line 15: | Line 17: | ||
The function '' | The function '' | ||
------------------------------------------------------- | ------------------------------------------------------- | ||
- | ===== Data Handler | + | ===== $metaType |
- | The handler can be of three types: | + | An existing or new type. The type definition should |
- | | + | ===== $actualType ===== |
- | - String: Post processing of data based on metaType passed. The string value must be that of a valid metaType | + | The physical |
- | - Object: An anonymous function that can be used to process data | + | |
+ | ===== $dictionaryType ===== | ||
+ | A Database specific field type, mapped to the metaType, e.g. **POINT**. This tells ADOdb how to handle the data n inserts and updates. | ||
+ | ===== $handleAsType ==== | ||
+ | One of the standard [[v5: | ||
+ | |||
+ | =====$callback ===== | ||
+ | |||
+ | The handler can be one of these types: | ||
+ | - Not set: No pre-processing of data prior to insertion of data. | ||
+ | - Object: An anonymous function that can be used to process data. | ||
+ | |||
+ | The callback function can be used to apply any changes to the data **prior** to the processing as type. | ||
===== Examples ===== | ===== Examples ===== | ||
==== Using A Passthrough Handler | ==== Using A Passthrough Handler | ||
Line 38: | Line 51: | ||
/* | /* | ||
* Now tell ADOdb how to handle the data in inserts and updates | * Now tell ADOdb how to handle the data in inserts and updates | ||
- | * see the entry for setCustomMetaType for an explanation | ||
*/ | */ | ||
$ok = $db-> | $ok = $db-> | ||
Line 61: | Line 73: | ||
}; | }; | ||
- | $ok = $db-> | + | $ok = $db-> |
</ | </ | ||
Line 70: | Line 82: | ||
* We must define the custom type before loading the data dictionary | * We must define the custom type before loading the data dictionary | ||
*/ | */ | ||
- | $ok = $db-> | + | $ok = $db-> |
- | $ok = $db-> | + | |
/* | /* | ||
Line 77: | Line 88: | ||
*/ | */ | ||
$dict = NewDataDictionary($db); | $dict = NewDataDictionary($db); | ||
- | |||
$tabname = " | $tabname = " | ||
Line 100: | Line 110: | ||
) | ) | ||
*/ | */ | ||
- | </ | + | </ |
v5/reference/connection/setcustommetatype.txt · Last modified: 2021/01/20 01:30 by mnewnham