mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fix incorrect $has_one documentation
The first mention of `$has_one` and `$db` in this file is incorrect, which is misleading. It's explained properly later on in the document, but it's easy to get it wrong based on this first code snippet.
This commit is contained in:
parent
76f2358f3b
commit
acc58c2b68
@ -861,10 +861,11 @@ In cases where image-only assets may be assigned to relationships then your data
|
||||
an `Image` datatype, or refer to `DBFile('image/supported')`.
|
||||
|
||||
```php
|
||||
use SilverStripe\Assets\Image;
|
||||
class MyObject extends SilverStripe\ORM\DataObject
|
||||
{
|
||||
private static $has_one = [
|
||||
"ImageObject" => "Image"
|
||||
"ImageObject" => Image::class
|
||||
];
|
||||
private static $db = [
|
||||
"ImageField" => "DBFile('image/supported')"
|
||||
|
Loading…
x
Reference in New Issue
Block a user