2024-02-29 02:33:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\FrameworkTest\LinkField\Extensions;
|
|
|
|
|
|
|
|
use SilverStripe\Core\Extension;
|
|
|
|
use SilverStripe\Forms\FieldList;
|
|
|
|
use SilverStripe\LinkField\Models\Link;
|
|
|
|
use SilverStripe\LinkField\Models\ExternalLink;
|
|
|
|
|
|
|
|
class CompanyExtension extends Extension
|
|
|
|
{
|
|
|
|
private static array $has_one = [
|
|
|
|
'CompanyWebSiteLink' => Link::class,
|
|
|
|
];
|
|
|
|
|
|
|
|
private static $has_many = [
|
|
|
|
'ManyCompanyWebSiteLink' => Link::class . '.Owner',
|
|
|
|
];
|
|
|
|
|
|
|
|
private static array $owns = [
|
|
|
|
'CompanyWebSiteLink',
|
|
|
|
'ManyCompanyWebSiteLink',
|
|
|
|
];
|
|
|
|
|
|
|
|
private static array $cascade_deletes = [
|
|
|
|
'CompanyWebSiteLink',
|
|
|
|
'ManyCompanyWebSiteLink',
|
|
|
|
];
|
|
|
|
|
|
|
|
private static array $cascade_duplicates = [
|
|
|
|
'CompanyWebSiteLink',
|
|
|
|
'ManyCompanyWebSiteLink',
|
|
|
|
];
|
|
|
|
|
2024-05-16 07:30:44 +02:00
|
|
|
protected function updateCMSFields(FieldList $fields)
|
2024-02-29 02:33:36 +01:00
|
|
|
{
|
2024-06-26 23:45:08 +02:00
|
|
|
$fields->dataFieldByName('CompanyWebSiteLink')->setAllowedTypes([ExternalLink::class]);
|
2024-02-29 02:33:36 +01:00
|
|
|
}
|
|
|
|
}
|