Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce feature version availability guidelines, add flags for 5.2 #501

Open
wants to merge 2 commits into
base: 5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
- [ ] The commit messages follow our [commit message guidelines](https://docs.silverstripe.org/en/contributing/code/#commit-messages)
- [ ] The PR follows our [contribution guidelines](https://docs.silverstripe.org/en/contributing/documentation/)
- [ ] The changes follow our [writing style guide](https://docs.silverstripe.org/en/contributing/documentation/#writing-style)
- [ ] Changes that are only effective from a certain minor version have an Info box flagging as such
- [ ] Code examples follow our [coding conventions](https://docs.silverstripe.org/en/contributing/coding_conventions/)
- [ ] CI is green
3 changes: 3 additions & 0 deletions en/02_Developer_Guides/00_Model/01_Data_Model_and_ORM.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ public function countDuplicates($model, $fieldToCheck)

### Common table expressions (CTE aka the `WITH` clause) {#cte}

> [!INFO]
> Common Table Expressions are available from version 5.2.

Common Table Expressions are a powerful tool both for optimising complex queries, and for creating recursive queries. You can use these by calling the [`DataQuery::with()`](api:SilverStripe\ORM\DataQuery::with()) method.

Note that there is no direct abstraction for this on `DataList`, so you'll need to [modify the underlying `DataQuery`](#modifying-the-underlying-query) to apply a CTE to a `DataList`.
Expand Down
3 changes: 3 additions & 0 deletions en/02_Developer_Guides/00_Model/02_Relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,9 @@ Eager loading supports all relationship types.

### Manipulating eager loading queries

> [!INFO]
> The filtering functionality in the Eager loading API is available from version 5.2.

There are some limitations to manipulating an `EagerLoadedList` (i.e. after the query has been executed).

The main limitation is that filtering or sorting an `EagerLoadedList` will be done in PHP rather than as part of the database query, since we have already loaded all its relevant data into memory.
Expand Down
3 changes: 3 additions & 0 deletions en/02_Developer_Guides/00_Model/08_SQL_Select.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ foreach ($columns as $alias => $ansiQuotedColumn) {

### Common table expressions (CTE aka the `WITH` clause) {#cte}

> [!INFO]
> Common Table Expressions are available from version 5.2.

Common Table Expressions are a powerful tool both for optimising complex queries, and for creating recursive queries. You can use these by calling the [`SQLSelect::addWith()`](api:SilverStripe\ORM\Queries\SQLSelect::addWith()) method.

Older database servers don't support this functionality, and the core implementation is only valid for MySQL (though community modules may add support for other database connectors). If you are using this functionality in an open source module or a project that you can't guarantee the type and version of database being used, you should wrap the query in a condition checking if CTEs are supported. You can do that by calling [`DB::get_conn()->supportsCteQueries()`](api:SilverStripe\ORM\Connect\Database::supportsCteQueries()).
Expand Down
3 changes: 3 additions & 0 deletions en/02_Developer_Guides/00_Model/09_Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ icon: check-square

## Validation using `symfony/validator` constraints {#symfony-validator}

> [!INFO]
> The `symfony/validator` integration is available from version 5.2.

The [`ConstraintValidator`](api:SilverStripe\Core\Validation\ConstraintValidator) class provides an abstraction around [`symfony/validator`](https://symfony.com/doc/current/components/validator.html), so you can easily validate values against symfony's validation constraints and get a [`ValidationResult`](api:SilverStripe\ORM\ValidationResult) object with the result.

```php
Expand Down
3 changes: 3 additions & 0 deletions en/02_Developer_Guides/07_Debugging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Backtrace::backtrace();

## Debugging database queries

> [!INFO]
> This functionality is available from version 5.2.

You can opt in to including a comment on all ORM queries indicating where the query was executed by setting the [DBQueryBuilder.trace_query_origin](api:SilverStripe\ORM\Connect\DBQueryBuilder->trace_query_origin) configuration property or the `SS_TRACE_DB_QUERY_ORIGIN` environment variable to `true`.

Note that the environment variable, if set, will take precedence over the configuration property value.
Expand Down
3 changes: 3 additions & 0 deletions en/02_Developer_Guides/14_Files/05_File_Manipulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ if ($file) {

## Convert a file to a different format {#file-conversion}

> [!INFO]
> The conversion APIs are available from version 5.2.

### The high-level API {#file-conversion-highlevel}

The [`File`](api:SilverStripe\Assets\File) and [`DBFile`](api:SilverStripe\Assets\Storege\DBFile) classes share a trait which implements a [`Convert()`](api:SilverStripe\Assets\ImageManipulation::Convert()) method.
Expand Down
1 change: 1 addition & 0 deletions en/10_Contributing/02_Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ documenting, there shouldn't be any "frequently asked questions" left.
- When referencing directories, always add a trailing slash to avoid confusions with regular files.
- "Silverstripe CMS" is used to refer to the Silverstripe CMS open source project as a whole.
- "Silverstripe" is used to refer to the company, where appropriate.
- When writing about a change introduced in a minor/patch release, include an Info box that declares the version it is relevant from, e.g. "This feature is available from version 5.2."

## Extended markdown syntax

Expand Down
Loading