Inherits PntClassDescriptor.
|
| __construct ($name) |
|
| addPropertyDescriptor ($aPntPropertyDescriptor) |
|
| setPolymorphismPropName ($value) |
|
| getPersistentFieldPropertyDescriptors () |
|
| getPersistentValuePropertyDescriptors () |
|
| getPersistentRelationPropertyDescriptors ($type='PntDbObject') |
|
| getTableName () |
|
| initTableMap (&$anArray) |
|
| getTableMap () |
|
| getFieldMap () |
|
| getFieldMapPrefixed () |
|
| getFieldMapForTable ($tableName) |
|
| getSelectQueryHandler () |
|
| getSelectQueryHandlerFor ($tableName, $tableMap, $fieldMapPrefixed) |
|
| getSimpleQueryHandler () |
|
| getFilters ($depth) |
|
| getAllFieldsFilter (&$filters, $type) |
|
| getFieldFilters () |
|
| getDefaultFilters ($depth) |
|
| addReferenceFilters (&$result, $prop, $depth) |
|
| getLabelSort ($filter=null) |
|
| getVerifyOnDelete () |
|
| getDescribedClassInstanceForData ($assocArray, $delegator) |
|
| checkPolyClassName ($className) |
|
| setPolyClassesAllowed ($map) |
|
| loadMissingFields ($peanut, $id, &$missingFieldsMap, $delegator) |
|
| peanutDeleted ($id) |
|
| peanutInserted ($peanut) |
|
| peanutCached ($id) |
|
| getPeanutsRunQueryHandler ($qh, $sortPath=null) |
|
| getPeanuts () |
|
| getPeanutsWith ($propertyName, $value) |
|
| getPeanutWithId ($id) |
|
| getPeanutsAccordingTo ($spec) |
|
| getPeanutsCount ($filter) |
|
| _loadMissingFields ($peanut, $id, &$missingFieldsMap, $delegator) |
|
| _getPeanutsRunQueryHandler ($qh, $sortPath=null) |
|
| _getDescribedClassInstanceForData ($assocArray, $delegator) |
|
| __construct ($name=null) |
|
| isPropertyDescriptorSet ($propertyName) |
|
| getPropertyDescriptors () |
|
& | refPropertyDescriptors () |
|
| getMultiValuePropertyDescriptors () |
|
| getSingleValuePropertyDescriptors () |
|
| getPropertyDescriptor ($name) |
|
| getTwinOf_type ($propName, $type) |
|
| addPropertyDescriptor ($anPntPropertyDescriptor) |
|
| hasPropertyDescriptor ($name) |
|
| getClassDir () |
|
| getLabel () |
|
| getUiColumnPaths () |
|
| getUiFieldPaths () |
|
| getUiPropertyDescriptors () |
|
| getParentclassDescriptor () |
|
| getDefaultLabelProp ($candidates, $reject) |
|
| getVerifyOnDelete () |
|
| getPeanutWithId ($id) |
|
| getPeanuts () |
|
| getPeanutsWith ($propertyName, $value) |
|
| getPeanutsAccordingTo ($spec) |
|
| _getPeanuts () |
|
| _getPeanutsWith ($propertyName, $value) |
|
| _getPeanutWithId ($id) |
|
| getName () |
|
| setName ($aString) |
|
| getLabel () |
|
| setLabel ($aString) |
|
| __toString () |
|
| toString () |
|
_getDescribedClassInstanceForData |
( |
|
$assocArray, |
|
|
|
$delegator |
|
) |
| |
_getPeanutsRunQueryHandler |
( |
|
$qh, |
|
|
|
$sortPath = null |
|
) |
| |
_loadMissingFields |
( |
|
$peanut, |
|
|
|
$id, |
|
|
& |
$missingFieldsMap, |
|
|
|
$delegator |
|
) |
| |
addPropertyDescriptor |
( |
|
$aPntPropertyDescriptor | ) |
|
addReferenceFilters |
( |
& |
$result, |
|
|
|
$prop, |
|
|
|
$depth |
|
) |
| |
checkPolyClassName |
( |
|
$className | ) |
|
Check wheather the class name is allowed for polymorphic persistency
- Parameters
-
string | $className | the class name |
getAllFieldsFilter |
( |
& |
$filters, |
|
|
|
$type |
|
) |
| |
getDefaultFilters |
( |
|
$depth | ) |
|
getDescribedClassInstanceForData |
( |
|
$assocArray, |
|
|
|
$delegator |
|
) |
| |
Returns an instance of the described class or if polymorphismPropName is set, from class according to data initialized from the data in the supplied associative array. When loading several tables may have been JOINed by the database. Eventually missing data is loaded using an extra query. In case of polymorphic retrieval that starts with a supertype, the mechanism is not efficient for the habit of MySQL not to include keys for null values: it causes en extra query to load 'missing' fields that are already queried for. It would be better to fetch the data as an indexed array, than map the indexes directly to fields...
- Returns
- PntDbObject (new or from chache)
- Exceptions
-
Returns the field to column mapping for the described class. For polymorphic persistency a single peanut can be mapped to several tables. This funtion returns a single fieldmap for all tables. When loading several tables may be JOINed by the database. Eventually missing data is loaded using an extra query.
- See Also
- _getDescribedClassInstanceForData
Because a fields persistence can be PNT_READ_ONLY, the map for loading the object is not necessarily the same as the map for saving. This method returns the fieldmap for loading, this includes fields whose propertyDescriptors' persistent === PNT_READ_ONLY
! There may still be methods that are not supporting fieldmapping ! Returns reference to cached Array, allways reset before using forEach or while each
- Returns
- columnNameMapping Associative Array with field names as the keys and (unprefixed) column names as the values
getFieldMapForTable |
( |
|
$tableName | ) |
|
For polymorphic persistency a single peanut can be mapped to several tables. This funtion returns a specific fiedMap for each table Because a fields persistence can be PNT_READ_ONLY, the map for loading the object is not necessarily the same as the map for saving. This method returns the fieldmap for saving, this excludes fields whose propertyDescriptors' persistent === PNT_READ_ONLY
- Parameters
-
String | $tableName | the name of the table to get the map for |
- Returns
- array fieldmap for saving, with fieldNames as keys and columnNames as values
Returns the field to column mapping for the described class.
! There may still be methods that do not yet support column mapping ! Returns reference to cached Array, allways reset before using forEach or while each
- Returns
- columnNameMapping Associative Array with field names as the keys and (prefixed) column names as the values
The filters are be produced by static getFilter() on the class. The default for that static is to call back getDefaultFilters(). it should add a filter for the label if required. Override the static to get different filters.
- Returns
- Array of PntSqlFilter the filters by which instances can be searched for
getLabelSort |
( |
|
$filter = null | ) |
|
Returns all the instances of the described class
- Returns
- Array
- Exceptions
-
getPeanutsAccordingTo |
( |
|
$spec | ) |
|
Returns the instances of the described class according to the supplied specification
- Parameters
-
- Returns
- PntObject
- Exceptions
-
getPeanutsCount |
( |
|
$filter | ) |
|
- Returns
- int the number of peanuts
- Parameters
-
getPeanutsRunQueryHandler |
( |
|
$qh, |
|
|
|
$sortPath = null |
|
) |
| |
Returns instances of the described class initialized from the supplied PntQueryHandler
- Returns
- Array
- Exceptions
-
getPeanutsWith |
( |
|
$propertyName, |
|
|
|
$value |
|
) |
| |
Returns the instances of the described class with the specfied property value to be equal to the specfied value
- Parameters
-
String | propertyName |
mixed | value |
- Returns
- Array $throws PntError
Returns the instance of the described class with the id to be equal to the specfied value, or null if none
- Parameters
-
- Returns
- PntObject
- Exceptions
-
getPersistentFieldPropertyDescriptors |
( |
| ) |
|
getPersistentRelationPropertyDescriptors |
( |
|
$type = 'PntDbObject' | ) |
|
getPersistentValuePropertyDescriptors |
( |
| ) |
|
getSelectQueryHandler |
( |
| ) |
|
getSelectQueryHandlerFor |
( |
|
$tableName, |
|
|
|
$tableMap, |
|
|
|
$fieldMapPrefixed |
|
) |
| |
getSimpleQueryHandler |
( |
| ) |
|
Return an array with the tablenames as keys, in parent first order
- Returns
- boolean Wheather some of the multi value properties onDelete = 'v' values recursively if onDelete = 'd'.
initTableMap |
( |
& |
$anArray | ) |
|
Return an array with table names as keys and class names as values. the first table will be used to obtain the id of new objects, with polymorphic retrieval this table should be the topmost persistent superclass, so that it contains a record for each logical instance in the polymorphism, making the ids unique for all objects within a polymorphism
- Returns
- Array the map
loadMissingFields |
( |
|
$peanut, |
|
|
|
$id, |
|
|
& |
$missingFieldsMap, |
|
|
|
$delegator |
|
) |
| |
Polymorphism support: $peanut has been initialized from data, but some field values where not in the data. Probably the query the data was retrieved with, was created by a superclass' classDescriptor. run another query to retrieve the missing data and initialize the peanut from it. PRECONDITION: $delegator not null
- Parameters
-
| PntDbObject | The peanut that is being retrieved |
integer | $id | The id of the object |
Array | $missingFieldsMap | With names of missing fields as keys and columnNames as values |
PntClassDescriptor | $delegator | The classDescriptor that issued the original query that resulted in delegation and missing fields |
- Exceptions
-
Register that a peanut has been deleted. The peanut must be removed from the cache.
- Parameters
-
integer | $id | the id of the deleted peanut |
peanutInserted |
( |
|
$peanut | ) |
|
Register that a peanut has been insetred. The peanut must be addes to the cache.
- Parameters
-
setPolyClassesAllowed |
( |
|
$map | ) |
|
set the classes that are allowed for polymorphic persistency
- Parameters
-
array | $map | with the names of the allowed classes as keys and not-null values WARNING: keys with values like false are allowed too! |
setPolymorphismPropName |
( |
|
$value | ) |
|
Set which property used for polymorphic retrieval If no value, retrieval is monomorphic (default)
- Parameters
-
String | the name of the property |
$polymorphismPropName = null |
Name of property that holds class name for polymorhism support
The documentation for this class was generated from the following file: