FacebookMetadataSiteConfig::updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
class FacebookMetadataSiteConfig extends DataExtension
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    public static $db = array(
6
        'SkipToMainContentAccessKey' => 'VarChar(1)',
7
    );
8
9
    public static $has_one = array(
10
        'FacebookLogo' => 'Image',
11
    );
12
13
    public function updateCMSFields(FieldList $fields)
14
    {
15
        $fields->renameField('SkipToMainContentAccessKey', _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
16
        $fields->addFieldToTab('Root.FacebookMetadata', new UploadField('FacebookLogo', _t('Facebook.METADATA_LOGO',
17
            'Image that will show in facebook when linking to this site. The image should be a square of minimum size 200px')));
18
    }
19
}
20