code/models/DublinCoreFieldType.php
/**
     * Add the default values for this.
     */
Add the default values for this.
Add the default values for this .
public function requireDefaultRecords()
    {
        parent::requireDefaultRecords();
        $options = array(
            'dc:title' => 'Title',
            'dc:creator' => 'Creator',
            'dc:subject' => 'Subject',
            'dc:description' => 'Description',
            'dc:publisher' => 'Publisher',
            'dc:contributor' => 'Contributor',
            'dc:modified' => 'Date',
            'dc:type' => 'Type',
            'dc:format' => 'Format',
            'dc:identifier' => 'Identifier',
            'dc:source' => 'Source',
            'dc:language' => 'Language',
            'dc:relation' => 'Relation',
            'dc:rights' => 'Rights'
        );
        foreach ($options as $key => $value) {
            $existing = DublinCoreFieldType::get()->filter('XmlName', $key)->first();
            if (!$existing) {
                $type = new self();
                $type->XmlName = $key; 
                $type->Label = $value;
                $type->write();
                DB::alteration_message(' - ' . $value . ' added.');
            } elseif ($existing->Label != $value) {
                $existing->Label = $value;
                $existing->write();
                DB::alteration_message(' - ' . $value . ' updated.');
            }
        }
    }
public function requireDefaultRecords ( ) { parent :: requireDefaultRecords ( ) ; $ options = array ( 'dc:title' => 'Title' , 'dc:creator' => 'Creator' , 'dc:subject' => 'Subject' , 'dc:description' => 'Description' , 'dc:publisher' => 'Publisher' , 'dc:contributor' => 'Contributor' , 'dc:modified' => 'Date' , 'dc:type' => 'Type' , 'dc:format' => 'Format' , 'dc:identifier' => 'Identifier' , 'dc:source' => 'Source' , 'dc:language' => 'Language' , 'dc:relation' => 'Relation' , 'dc:rights' => 'Rights' ) ; foreach ( $ options as $ key => $ value ) { $ existing = DublinCoreFieldType :: get ( ) -> filter ( 'XmlName' , $ key ) -> first ( ) ; if ( ! $ existing ) { $ type = new self ( ) ; $ type -> XmlName = $ key ; $ type -> Label = $ value ; $ type -> write ( ) ; DB :: alteration_message ( ' - ' . $ value . ' added.' ) ; } elseif ( $ existing -> Label != $ value ) { $ existing -> Label = $ value ; $ existing -> write ( ) ; DB :: alteration_message ( ' - ' . $ value . ' updated.' ) ; } } }
Add the default values for this.
Add the default values for this .
// All dublin core field types as detailed on this web page... // http://www.ogcnetwork.net/node/630 // Run through and create all of them if not already existing. // This field is effectively the Unique key for this table.