Adrexia\Brand\Brand
Synopsis
class Brand
extends DataObject
implements
PermissionProvider
{
- // members
- private static string $table_name = 'Brand';
- private static array $db = ;
- private static array $has_one = ;
- private static array $defaults = ;
- private static boolean $edit_constrast_options = true;
- private static boolean $edit_palette_options = true;
- private static boolean $edit_bodycolors = true;
- private static boolean $edit_menucolors = true;
- private static boolean $edit_fonts = true;
- private static boolean $edit_images = true;
- // methods
- public void getCMSFields()
- public void addContrast()
- public void addPalette()
- public void addImages()
- public void addFonts()
- public void addBodyColours()
- public void addMenuColours()
- public void onAfterWrite()
- public array getContrastColours()
- public array getPaletteColours()
- public array getFullPalette()
- public String getHex()
- public array getRGBArray()
- public String getColorAsRGB()
- public Int getBrightnessCalc()
- public String getContrast()
- public void canView()
- public void canEdit()
- public void canDelete()
- public bool|int canCreate()
- public array providePermissions()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
- SilverStripe\Core\Config\Configurable
Implements
- SilverStripe\Security\PermissionProvider
Members
private
- $db
- $defaults
- $edit_bodycolors
- $edit_constrast_options
- $edit_fonts
- $edit_images
- $edit_palette_options
- $has_one
- $table_name
Methods
public
- addBodyColours()
- addContrast()
- addFonts()
- addImages()
- addMenuColours()
- addPalette()
- canCreate() — Limit to one brand per (sub)site
- canDelete()
- canEdit()
- canView()
- getBrightnessCalc() — Returns a brightness calculation (lower numbers are darker, higher is lighter)
- getCMSFields()
- getColorAsRGB() — Converts a hex value into an rgb value. Can be used in the template to crwate rgba colours.
- getContrast() — Returns a string of the current contrast of a colour (light or dark) Useful for calculating whether a text colour must be dark or light, when supplied with a background colour. If this outputs light, then we know the text must be a dark shade in order to get satisfactory contrast
- getContrastColours() — Returns the CMS defined contrasting colours palette.
- getFullPalette() — Returns the CMS defined colour palette.
- getHex() — Takes a Brand DB field name and returns the associated Hex colour
- getPaletteColours() — Returns the CMS defined Brand colours palette.
- getRGBArray() — Converts a hex value into an array of rgb values (red, green, blue) Can be used to construct an rgba version of the colour And/Or do colour maths.
- onAfterWrite() — Publish our dependent objects.
- providePermissions() — Get an array of {@link Permission} definitions that this object supports