diff --git a/README.md b/README.md index c0e6212..88f73f4 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ ## Installation (with composer) $ composer require heyday/silverstripe-abtesting:~0.1 + + For 2.4 see the tag 0.1.7 ## Usage diff --git a/code/ABTestingConfigExtension.php b/code/ABTestingConfigExtension.php index 0550c73..e13bdb7 100644 --- a/code/ABTestingConfigExtension.php +++ b/code/ABTestingConfigExtension.php @@ -3,30 +3,20 @@ /** * Class ABTestingConfigExtension */ -class ABTestingConfigExtension extends Extension +class ABTestingConfigExtension extends DataExtension { - /** - * Required for DataObject extensions - * - * @return array - */ - public function extraStatics() - { - return array( - 'db' => array( - 'ABGlobalTest' => 'Boolean', - 'ABTestGlobalScript' => 'Text' - ) - ); - } + public static $db = array( + 'ABGlobalTest' => 'Boolean', + 'ABTestGlobalScript' => 'Text' + ); /** * Update the CMS fields on the extended object * - * @param FieldSet $fields + * @param FieldList $fields */ - public function updateCMSFields(FieldSet &$fields) + public function updateCMSFields(FieldList $fields) { $member = Member::currentUser(); diff --git a/code/ABTestingExtension.php b/code/ABTestingExtension.php index 9167684..fe8418e 100644 --- a/code/ABTestingExtension.php +++ b/code/ABTestingExtension.php @@ -3,19 +3,9 @@ /** * Class ABTestingExtension */ -class ABTestingExtension extends Extension +class ABTestingExtension extends DataExtension { - /** - * Required for DataObject extensions - * - * @return array - */ - public function extraStatics() - { - return array(); - } - /** * @var array */ diff --git a/code/ABTestingPageExtension.php b/code/ABTestingPageExtension.php index 612f868..00c46d1 100644 --- a/code/ABTestingPageExtension.php +++ b/code/ABTestingPageExtension.php @@ -3,30 +3,20 @@ /** * Class ABTestingPageExtension */ -class ABTestingPageExtension extends Extension +class ABTestingPageExtension extends DataExtension { - /** - * Required for DataObject extensions - * - * @return array - */ - public function extraStatics() - { - return array( - 'db' => array( - 'ABTestPage' => 'Boolean', - 'ABTestInlineScript' => 'Text' - ) - ); - } + public static $db = array( + 'ABTestPage' => 'Boolean', + 'ABTestInlineScript' => 'Text' + ); /** * Update the CMS fields on the extended object * - * @param FieldSet $fields + * @param FieldList $fields */ - public function updateCMSFields(FieldSet &$fields) + public function updateCMSFields(FieldList $fields) { $member = Member::currentUser();