Source of file MetadataSchemaLink.php
Size: 0,678 Bytes - Last Modified: 2021-12-23T10:25:41+00:00
/var/www/docs.ssmods.com/process/src/code/dataobjects/MetadataSchemaLink.php
123456789101112131415161718192021222324252627282930313233 | <?php /** * A link that attaches a metadata schema to an arbitrary object. * * @package silverstripe-metadata */ class MetadataSchemaLink extends DataObject { private static $db = array( 'ParentClass' => 'Varchar(100)', 'ParentID' => 'Int' ); private static $has_one = array( 'Schema' => 'MetadataSchema' ); /** * @return DataObject */ public function getParent() { return DataObject::get_by_id($this->ParentClass, $this->ParentID); } public function onBeforeWrite() { $this->ParentClass = ClassInfo::baseDataClass($this->ParentClass); parent::onBeforeWrite(); } } |