mapbender / data-source
Mapbender data source handler
Installs: 9 887
Dependents: 4
Suggesters: 0
Security: 0
Stars: 1
Watchers: 22
Forks: 2
Open Issues: 3
Requires
- php: >=5.3.3
- doctrine/dbal: ^2.11 || ^3
- doctrine/persistence: ^1.3.0 || ^2
Requires (Dev)
- dev-master / 0.2.x-dev
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.30
- 0.1.29
- 0.1.28
- 0.1.27
- 0.1.26
- 0.1.25
- 0.1.24
- 0.1.23
- 0.1.22
- 0.1.21
- 0.1.20
- 0.1.19
- 0.1.18
- 0.1.17
- 0.1.16.2
- 0.1.16.1
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11.1
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.0.35
- 0.0.34
- 0.0.33
- 0.0.32
- 0.0.31
- 0.0.30
- 0.0.29
- 0.0.28
- 0.0.27
- 0.0.26
- 0.0.25
- 0.0.24
- 0.0.23
- 0.0.22
- 0.0.21
- 0.0.20
- 0.0.19
- 0.0.18
- 0.0.17
- 0.0.16
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- 0.0.1-beta.1
- dev-customer-A1020
- dev-release/0.1
- dev-feature/migrate-feature-type
- dev-develop-fr
- dev-feature/adminGUI
- dev-fix/8887
- dev-feature/spatialite-integration
This package is auto-updated.
Last update: 2023-01-07 11:21:24 UTC
README
Components abstracting raw doctrine tables into repositories.
The base DataStore is a repository promoting loaded rows into DataItem objects, and also supports DataItem objects when updating / inserting.
FeatureType is an extended repository type with spatial data support. It loads / stores Feature objects, with dedicated methods for accessing / replacing the geometry. The geometry is internally always an EWKT, but methods are provided to get / update the plain WKT or the SRID individually.
Only a single geometry column per table is supported.
Main repository methods
Method search
loads all rows from the table and promotes them into an array of DataItem / Feature objects.
Accepts an array of controlling parameters. Allowed params are maxResults
, where
(string; additional
SQL where clause). FeatureType additionally supports params srid
(explicit geometry output SRID) and intersect
(string; (E)WKT geometry to spatially limit results).
Method count
Accepts the same parameters as search, but returns only the number of matched rows.
Method getById
loads one DataItem / Feature. Filters are skipped.
Methods save
, insert
, update
perform storage. save
auto-inflects to insert or update, depending on
the presence of an id in the passed argument. These methods accept either DataItem / Feature objects or arrays.
The affected or new row is reloaded and returned as a DataItem / Feature object.
Method delete
removes the row corresponding with an id or a specific DataItem / Feature object.
Configuring repositories
Named DataStore / FeatureType repositorys can be pre-configured
globally via container parameters (dataStores
and featureTypes
respectively),
or instantiated ad hoc from a configuration array.
DataStore configuration supports the following values:
name | type | description | default |
---|---|---|---|
connection | string | name of doctrine connection | "default" |
table | string | name of table; required | -none- |
uniqueId | string | name of primary id column | "id" |
fields | list of strings | names of columns to load into DataItem / Feature objects | null (=auto-detect columns) |
filter | string | valid SQL where clause to build into all search invocations |
null |
geomField (FeatureType only) | string | name of the geometry column | "geom" |
srid (FeatureType only) | integer or null | Source srid of geomField ; used only if detection fails (certain views) |
null |
NOTE: you should not attempt placing spatial data into the "default" database containing your Doctrine entities. You will encounter errors running Doctrine schema updates.
NOTE: Both the filter
setting and the where
search param may use a magic placeholder :userName
, which is
automatically bound to the name of the user running the query.