mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Add ownership model for files
This commit is contained in:
parent
c272a25cb2
commit
d2711a82bb
@ -94,6 +94,12 @@ class BasicFieldsTestPage extends TestPage
|
|||||||
'Listbox' => 'SilverStripe\\FrameworkTest\\Model\\TestCategory',
|
'Listbox' => 'SilverStripe\\FrameworkTest\\Model\\TestCategory',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private static $owns = [
|
||||||
|
'AttachedFile',
|
||||||
|
'File',
|
||||||
|
'Image',
|
||||||
|
];
|
||||||
|
|
||||||
private static $defaults = array(
|
private static $defaults = array(
|
||||||
'Validated' => 2
|
'Validated' => 2
|
||||||
);
|
);
|
||||||
@ -270,11 +276,11 @@ class BasicFieldsTestPage extends TestPage
|
|||||||
));
|
));
|
||||||
|
|
||||||
$fields->addFieldsToTab('Root.File', array(
|
$fields->addFieldsToTab('Root.File', array(
|
||||||
$bla = UploadField::create('File', 'UploadField with multiUpload=false')
|
$bla = UploadField::create('File', 'UploadField with multiUpload=false (owned by page)')
|
||||||
->setDescription($description)
|
->setDescription($description)
|
||||||
->setRightTitle($rightTitle)
|
->setRightTitle($rightTitle)
|
||||||
->setIsMultiUpload(false),
|
->setIsMultiUpload(false),
|
||||||
UploadField::create('Image', 'UploadField for image')
|
UploadField::create('Image', 'UploadField for image (owned by page)')
|
||||||
->setDescription($description)
|
->setDescription($description)
|
||||||
->setRightTitle($rightTitle),
|
->setRightTitle($rightTitle),
|
||||||
UploadField::create('HasManyFiles', 'UploadField for has_many')
|
UploadField::create('HasManyFiles', 'UploadField for has_many')
|
||||||
|
Loading…
Reference in New Issue
Block a user