Skip to content

Commit

Permalink
Merge pull request #482 from creative-commoners/pulls/5.2/review-chan…
Browse files Browse the repository at this point in the history
…gelog

Review of the Silverstripe CMS 5.2.0 changelog
  • Loading branch information
sabina-talipova authored Mar 19, 2024
2 parents f9a7355 + 7e4e346 commit ab61e02
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 77 deletions.
6 changes: 3 additions & 3 deletions en/02_Developer_Guides/00_Model/08_SQL_Select.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ Common Table Expressions are a powerful tool both for optimising complex queries
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()).
```php
if (DB::get_conn()->supportsCteQueries()) {
// Supports non-recursive CTE clause
} elseif (DB::get_conn()->supportsCteQueries(true)) {
if (DB::get_conn()->supportsCteQueries(true)) {
// Supports recursive CTE clause
} elseif (DB::get_conn()->supportsCteQueries()) {
// Supports non-recursive CTE clause
} else {
// No CTE support
}
Expand Down
4 changes: 2 additions & 2 deletions en/02_Developer_Guides/00_Model/09_Validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: check-square

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

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 as a result.
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
use SilverStripe\Core\Validation\ConstraintValidator;
Expand All @@ -20,7 +20,7 @@ use SilverStripe\Core\Validation\ConstraintValidator;
$result = ConstraintValidator::validate($valueToValidate, $constraint);
```

To test if a URL is valid, for example:
For example, to test if a URL is valid:

```php
use SilverStripe\Core\Validation\ConstraintValidator;
Expand Down
Loading

0 comments on commit ab61e02

Please sign in to comment.