MINOR Documentation for new Config system and DataExtension/extraStatics #345

Merged
merged 1 commit into from Apr 19, 2012

Projects

None yet

4 participants

@halkyon
Member
halkyon commented Apr 18, 2012

No description provided.

@hafriedlander
Member

Looks mostly good. This bit is wrong:

This would now become a static function add_to_class:

<?php
//...
static function add_to_class($class, $extensionClass, $args = null) {
    if($class == 'MyClass') {
        return array(
            'db' => array(
                'Title' => 'Varchar'
            );
        );
    }
}

That won't do anything, we don't care about the return value :)

It should be:

This would now become a static function add_to_class:

<?php
//...
static function add_to_class($class, $extensionClass, $args = null) {
    if($class == 'MyClass') {
        Config::inst()->update($class, 'db', array('Title' => 'Varchar'));
    }
    parent::add_to_class($class, $extensionClass, $args);
}
@halkyon
Member
halkyon commented Apr 18, 2012

@hafriedlander Thanks for the feedback. I'll fix that up!

@halkyon
Member
halkyon commented Apr 18, 2012

@hafriedlander Fixed, based on your example.

@wilr
Member
wilr commented Apr 19, 2012

Changelog is all well and good but shouldn't this be in the main documentation for DataExtension and have changelog link to the DataExtension page?

@chillu chillu merged commit a687292 into silverstripe:master Apr 19, 2012
@chillu
Member
chillu commented Apr 19, 2012

There's a separate ticket for documeting the Config API: http://open.silverstripe.org/ticket/7141 - I've just extended that to documenting DataExtension as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment