Source of file MetadataType.php
Size: 0,959 Bytes - Last Modified: 2021-12-23T10:04:56+00:00
/var/www/docs.ssmods.com/process/src/code/model/MetadataType.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php /** * Milkyway Multimedia * MetadataType.php * * @package milkyway-multimedia/ss-dataobject-metadata * @author Mellisa Hankins <mell@milkywaymultimedia.com.au> */ class MetadataType extends DataObject { private static $singular_name = 'Metadata'; private static $description = 'This is the metadata/attribute type that is used as a specification for the DataObject'; private static $db = [ 'Title' => 'Varchar', 'Reference' => 'Varchar', 'Default' => 'Varchar', 'Description' => 'HTMLText', 'Enabled' => 'Boolean', ]; private static $defaults = [ 'Enabled' => true, ]; public function onBeforeWrite() { parent::onBeforeWrite(); if(!$this->Reference) $this->Reference = implode(' - ', $this->referenceParts()); } public function referenceParts() { $parts = [$this->Title]; return $parts; } } |