Commit Graph

28 Commits

Author SHA1 Message Date
Michal Kleiner 21129b1624
Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
Daniel Hensby 237b2d5f74
Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
Maxime Rainville 8ee50d2ba7 API Remove DataObjectSchema::getFieldMap() (#8960)
Introduced as a less public API in https://github.com/silverstripe/silverstripe-assets/pull/227
2019-05-06 12:33:23 +12:00
Andre Kiste 0c6c57f1ef Add `getFieldMap` method to retrieve a list of all fields for any giv… (#8892)
* Add `getFieldMap` method to retrieve a list of all fields for any given class

* Add `TagsToShortcodeTask` to upgrading guide

Adding after the file migration part as this is where it makes the most sense to run it.

* `getFieldMap` accepts an array

* Move to `DataObjectSchema`

* Add `HTMLVarchar` to documentation
Minor refactoring

* Add test for checking that `subclassesfor` works without the base class
Add test `DataObjectSchema::getFieldMap` returns the correct array

* Remove cms dependency
2019-04-30 10:43:14 +12:00
Robbie Averill 74698af402 [SS-2018-020] Ensure that table names are escaped to prevent possible SQL injection 2018-12-11 20:57:18 +13:00
Daniel Hensby ec956a682d API Moving tests to use transactions 2018-06-13 09:35:45 +12:00
Damian Mooyman 77a45c0dbc
Merge remote-tracking branch 'origin/4.1' into 4
# Conflicts:
#	src/Forms/HTMLEditor/HTMLEditorSanitiser.php
#	src/ORM/DataObjectSchema.php
#	src/ORM/Queries/SQLSelect.php
#	src/View/Parsers/ShortcodeParser.php
2018-06-11 10:19:04 +12:00
Damian Mooyman 0aa13da0d9
BUG Backport bugfix for belongs_many_many with many_many through.
Partial backport of #7928
Fixes #8131
2018-06-06 09:43:04 +12:00
Damian Mooyman 257ff69e32 API Implement many_many through polymorphic (from only) (#7928)
* API Support many_many through polymorphic relations (from side only)
Fixes #7911
Fixes #3136

* Add extra docs and allow optional arguments

* ENHANCEMENT Enable quiet to be turned off

* BUG Fix issue with manymanythroughlist duplication
2018-03-22 10:26:25 +13:00
Damian Mooyman aa2c71424d
API Implement cascade_duplications
API Add DataObject::setComponent()
API Support unary components as getter and setter fields
API ManyManyList::add() now supports unsaved records
ENHANCEMENT Animal farm
2018-02-05 12:04:57 +13:00
Daniel Hensby ebeaf3e40d
Merge branch '3' into 4 2018-01-16 11:47:39 +00:00
Loz Calver 0e1753f33d FIX: Only show table_name warning on dev/build 2017-12-11 17:33:39 +00:00
Damian Mooyman 69decdf3a4
BUG Don't warn on table name for classes without tables
Fixes #7686
2017-12-11 09:55:57 +13:00
Loz Calver 91bd92df31 FIX: Remove some unnecessary ClassInfo calls in DataObjectSchema 2017-12-05 12:23:10 +00:00
Christopher Joe cc72b5c852 BUG Added warning for auto-generated table_name for non-test classes 2017-11-27 20:22:37 +13:00
Robbie Averill fb18e441a7 DBIndexable::getIndexSpecs is responsible for returning a DBFields full indexable spec 2017-07-18 15:03:56 +12:00
Robbie Averill bd5782adca NEW Allow index type to be configured per DBField instance 2017-07-17 14:36:47 +12:00
Robbie Averill c9c4390619 NEW Ensure polymorphic has_one fields are indexed
* Add tests for config based indexing on composite DBFields
* Allow fields to have "indexed" option passed via field spec
2017-07-17 14:36:29 +12:00
Damian Mooyman f65e3627dc
BUG Implement or exclude all pending upgrader deltas 2017-07-03 12:21:47 +12:00
Nick acb74a8577 Fix $class variable from being clobbered
The $class variable gets overwritten in the function.

This causes error messages to be less helpful. For example if you setup a has_many but forget the has_one on the other side the error will look something like

`[Emergency] Uncaught Exception: No has_one found on class 'SomeObject', the has_many relation from 'SilverStripe\View\ViewableData' to 'SomeObject' requires a has_one on 'SomeObject'`

fixing this gives a more useful error, like

`[Emergency] Uncaught Exception: No has_one found on class 'SomeObject', the has_many relation from 'Page' to 'SomeObject' requires a has_one on 'SomeObject'`
2017-05-29 20:31:09 +12:00
Damian Mooyman 963d9197d3
API Ensure that all DataQuery joins are aliased based on relationship name 2017-05-26 13:38:58 +12:00
Daniel Hensby 3e556b5966
NEW Move index generation to DataObjectSchema and solidify index spec 2017-05-25 23:29:12 +01:00
Damian Mooyman fba8e2c245 API Remove Object class
API DataObjectSchema::manyManyComponent() return array is now associative array
2017-05-23 13:50:35 +12:00
Damian Mooyman ac3a9c9e6e API Split out SilverStripe\ORM\Versioned into new module 2017-03-27 11:03:39 +13:00
Damian Mooyman 1186f07830 API Use mysql-safe table namespace separator 2017-03-24 14:17:30 +13:00
Damian Mooyman 3362e15a29 API Upgrade code to use updated config 2017-02-27 16:54:01 +13:00
Damian Mooyman 1b1e921e3d
PSR2: Whitespace-only changes 2016-11-29 12:31:16 +13:00
Sam Minnee 7a10c194bd NEW: Move code files into src/ folder.
This updates framework to be more in keeping with PHP conventions.
2016-11-01 13:37:24 +13:00