Commit Graph

555 Commits

Author SHA1 Message Date
Guy Sartorelli
2836478c72 API Add method to get foreign class key on polymorphic has_many 2022-05-02 18:29:01 +12:00
Steve Boyd
337c6e583c ENH Various fixes for PHP 8.1 compatibility 2022-04-27 09:29:40 +12:00
Steve Boyd
511b3bb060 ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00
Steve Boyd
f1678781a2 ENH Various fixes for PHP 8.1 compatibility 2022-04-11 17:22:22 +12:00
Steve Boyd
814c5b2fd0 ENH Fix deprecation issues for PHP 8.1 compatibility 2022-04-06 11:34:34 +12:00
Steve Boyd
0318372641 API Implement updated Serializable API 2022-02-14 13:26:11 +13:00
Tyler Trout
6b1c5eb6d7
NEW Allow methods to be used for flexible searchable_fields (#10199)
* Allow methods to be used for flexible searchable_fields

* match_any key

* Documentation

* Update docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md

Co-authored-by: GuySartorelli <36352093+GuySartorelli@users.noreply.github.com>

* Search fields test

* Newlines

* Update src/ORM/Search/SearchContext.php

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>

* Update docs/en/02_Developer_Guides/00_Model/11_Scaffolding.md

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>

* Removed comments and whitespace. Linting fixes

Co-authored-by: GuySartorelli <36352093+GuySartorelli@users.noreply.github.com>
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2022-02-10 09:40:16 +13:00
Mojmir Fendek
89c87ddbf8
NEW: Static validation for relationships. (#9874)
* NEW: Static validation for relationships.

* Unit tests added.

* PR fixes

* PR feedback: Execute validation on flush.

* PR fixes.

* PR fixes.
2022-02-04 14:41:09 +13:00
Ingo Schommer
d8499a24d0
NEW NullDatabase (#10016)
* NEW DatabaselessKernel to support operation without DB

This is required for GraphQL code generation in CI (without a working runtime database/webserver environment).
Context: https://github.com/silverstripe/silverstripe-graphql/issues/388

* New --no-database option for sake

* Refactor to abstract class

* Apply feedback peer review

Co-authored-by: Aaron Carlino <unclecheese@leftandmain.com>
Co-authored-by: Maxime Rainville <maxime@silverstripe.com>
2022-02-04 10:07:27 +13:00
LiamKearn
ce3e07a189
DOC DBComposite reword to make a little more sense. (#10193)
* Docs: DBComposite reword to make a little more sense.
* Update src/ORM/FieldType/DBComposite.php
Docs: Rewording DBComposite explanation based on feedback
Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2022-01-18 15:52:01 +13:00
Mojmir Fendek
3db1435df7
NEW: Allow DateTime to be immutable (#10125)
* BUG: Datetime modify() returns a new field instance.
* PR fixes.
* PR fixes.
2022-01-18 09:41:11 +13:00
Nicolaas / Sunn Side Up
d1cac485b7
ENH Speed up DataObject::get_by_id by checking if there is an ID at all 2022-01-17 09:45:56 +13:00
Michal Kleiner
dee0b1faf4
Merge pull request #10020 from GuySartorelli/patch-4
FIX Remove limits in removeAll method
2022-01-15 10:42:19 +13:00
Michal Kleiner
645e1f14bd
Merge pull request #10173 from GuySartorelli/patch-2
FIX Allow custom SELECT to be used for sorting in DataQuery::column()
2021-12-14 10:23:48 +13:00
GuySartorelli
0b0c13764b FIX allow custom SELECT to be used for sorting in DataQuery::column().
If a custom select clause (using special features such as `CASE`) is used, and it was added using `SQLSelect::selectField`, the custom select clause should be retained when calling DataQuery::column().
2021-12-14 08:01:02 +13:00
Lukas
552cf5944d
MNT Fix various typos with codespell (#10177) 2021-12-13 21:05:33 +13:00
Maxime Rainville
27d7c2fe85
Merge pull request #9749 from gurucomkz/patch-9453-mysql8-ints
FIX Don't use int width for mysql >= 8.0.17 #9453
2021-12-13 12:39:12 +13:00
Thomas Portelange
97ab957de8
ENH Use ::create to get DropdownField instance in DBEnum (#10175)
This allows using alternate dropdown implementation.
2021-12-11 20:12:07 +13:00
Sergey Shevchenko
9e2d661689 FIX: Make MySQLSchemaManager::shouldUseIntegerWidth() private 2021-12-08 11:19:47 +13:00
Sergey Shevchenko
e68e65badc feat: added config value to force certain behaviour & added a note to the docs 2021-12-08 11:18:00 +13:00
Sergey Shevchenko
2c9ba8bc45 fix: conform with linter 2021-12-08 11:18:00 +13:00
Sergey Shevchenko
62725a5db3 fix: added exception for MariaDB 2021-12-08 11:18:00 +13:00
Sergey Shevchenko
5e26757a9e
Merge branch 'silverstripe:4' into 4 2021-11-15 22:07:11 +13:00
Loz Calver
20134e6a4f
NEW Add FirstPage() and LastPage() to PaginatedList (#10129) 2021-11-08 09:26:21 +13:00
Sergey Shevchenko
04b7ad51b8
Merge branch 'silverstripe:4' into 4 2021-11-01 13:12:59 +13:00
GuySartorelli
059d8aac0a
NEW Add afterUpdateCMSFields method to DataObject. (#9819) 2021-10-26 16:05:11 +13:00
Mo Alsharaf
2c1ef4df23
MNT Update URL in docs for ICU documentation (#10118) 2021-10-15 11:28:16 +13:00
Michal Kleiner
38fe326262 MNT Fix minor typos 2021-09-25 00:23:43 +12:00
Michal Kleiner
1e5414eac7 FIX Use correct ancestor class when querying for stage and live children
The right ancestor class that has the Hierarchy extension applied needs to be used
since it doesn’t have to be the class directly extending from DataObject, which means
the ID and ParentID columns might be in different tables.
2021-09-25 00:23:43 +12:00
Matt Peel
f99ba5d716 NEW Add extension point to DataObject->hydrate() 2021-08-25 16:07:02 +12:00
GuySartorelli
cacd762357
Avoid "new" keyword to instantiate CompositeValidator
The CompositeValidator is Injectable, so we should allow project code to replace it here via the Injector.
2021-08-02 12:46:53 +12:00
GuySartorelli
5699db306d
FIX: Remove limits in removeAll method.
Keeping a limit here results in a DatabaseException "This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"
2021-07-12 17:14:46 +12:00
Steve Boyd
f6e8d6e591 Merge branch '4.8' into 4 2021-07-07 14:03:02 +12:00
Steve Boyd
87d076faa6 FIX Cast DBInt value to int 2021-07-06 16:43:54 +12:00
Steve Boyd
8e803bbcfc FIX Parse Enums with dots in their values 2021-07-01 16:00:08 +12:00
Steve Boyd
9463aaf571 Merge branch '4.8' into 4 2021-06-08 11:49:01 +12:00
David Peck
28b5b803be FIX Defensively copy mocked datetime 2021-06-05 16:46:19 +12:00
Michal Kleiner
2017a20433 FIX Use empty array as a fallback for preg_split within dbtext summary
If the content is invalid for whatever reason e.g. when instantiating
a DBText field to get a summary of text through
`DBField::create_field('Text', $content)->Summary(10)`, preg_split returns
false and the rest of the code expects an array.
This tweak ensures an array is always returned even when preg_split fails.
2021-06-02 15:17:58 +12:00
Steve Boyd
a3df66860f Merge branch '4.8' into 4 2021-05-31 17:05:11 +12:00
Steve Boyd
9ccdb8efb2 Merge branch '4.7' into 4.8 2021-05-31 17:04:54 +12:00
Maxime Rainville
472fc4ebb4
BUG Update DataQuery::exists to return false when limit causes no result to be returned (#9946)
* BUG Update DataQuery::exists to return false when limit causes no result to be returned

* Update comment

* Fixing linting issue
2021-05-31 16:50:58 +12:00
Sam Minnee
c7c6bdebdf FIX: Allow join-object to be referenced as a component
This avoids having arbitrary differences between a join object and a
has-one relation.
2021-05-20 20:32:25 +12:00
Maxime Rainville
6fc25e4e96
RFC Add chunk method to DataList to iterate over large dataset (#8940) 2021-04-14 07:49:44 +12:00
Nicolaas
2ecd8b34ee
adding use SilverStripe\Security\Member; to make sure linting works
adding `use SilverStripe\Security\Member;` to make sure that linting works.
2021-04-01 23:36:36 +13:00
Nicolaas
504e20320e
Update DBBoolean.php (#9893) 2021-03-24 12:05:33 +13:00
Joe Harvey
33365b92f3 Bug Fix - Ensure DataQuery::exists() SQL is both valid MySQL and T-SQL
The original SQL statement is not valid T-SQL for use with SQL Server
2021-02-08 17:22:20 +00:00
Maxime Rainville
9ca33950a2
API Add a CREATE_MEMORY_HYDRATED option to DataObject constructor (#9767) 2021-01-21 14:07:06 +13:00
3Dgoo
d1cca0f3fb
Fix DataQuery::exists() not working correctly
Fixes `DataQuery::exists()` not working correctly in some cases as discussed in #9809
2021-01-20 17:03:36 -08:00
Steve Boyd
ed5c1488c8
Merge pull request #9817 from creative-commoners/pulls/4/fix-dbcomposite-indexspecs
FIX DBComposite getIndexSpecs method
2021-01-17 11:18:35 +13:00
Ingo Schommer
6153f441ee Merge branch 'phpdoc-fixes' into 4 2021-01-14 11:08:22 +13:00