Skip to content

Commit

Permalink
Merge pull request #311 from creative-commoners/pulls/4.13/exclude-so…
Browse files Browse the repository at this point in the history
…me-summary-fields

DOC Warnings about searchable_fields content
  • Loading branch information
GuySartorelli committed Aug 3, 2023
2 parents b6e54b1 + 0a187ea commit 6371800
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions en/02_Developer_Guides/00_Model/11_Scaffolding.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ The `$searchable_fields` property uses a mixed array format that can be used to
system. The default is a set of array values listing the fields.

[info]
`$searchable_fields` will default to use the [`$summary_fields` config](#summary-fields) if not defined. This works fine unless
your `$summary_fields` config specifies fields that are not stored in the database.
`$searchable_fields` will default to use the [`$summary_fields` config](#summary-fields), excluding anything that isn't a database field (such as method calls) if not explicitly defined.
[/info]

[warning]
If you define a `searchable_fields` configuration, _do not_ specify fields that are not stored in the database (such as methods), as this will cause an error.
[/warning]

```php
use SilverStripe\ORM\DataObject;

Expand Down

0 comments on commit 6371800

Please sign in to comment.