Skip to content

Commit

Permalink
Merge branch '6.0' into 6
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 22, 2025
2 parents 767e5a8 + a1b0289 commit 36be8c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions en/02_Developer_Guides/00_Model/12_Indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ support the following:
- `unique`: Index plus uniqueness constraint on the value
- `fulltext`: Fulltext content index

> [!NOTE]
> Violating a unique index will throw a [`DuplicateEntryException`](api:SilverStripe\ORM\Connect\DuplicateEntryException) exception which you can catch and handle to produce appropriate validation messages.
>
> If the violation happens when calling [`DataObject::write()`](api:SilverStripe\ORM\DataObject::write()), the exception will be caught and a [`ValidationException`](api:SilverStripe\ORM\ValidationException) will be thrown instead. The CMS catches any `ValidationException` and displays them as user friendly validation errors in edit forms.
```php
// app/src/MyTestObject.php
namespace App\Model;
Expand Down

0 comments on commit 36be8c0

Please sign in to comment.