silverstripe/sapphire — pull request #1735 by wilr (2013-04-07 09:04:31+00:00)
Title: Discussion: Fluent DBField API

*Do not merge*

Before I continue with this, thought I would discuss the practically of it (@sminnee, @chillu).

Idea being much like the DataList API that DBField functions that manipulate data return new DBField instances rather than strings. The benefit of this is a consistent API between the template and PHP (i.e $this->dbObject('Created')->Long()->UpperCase()). This pull request doesn't fix any of the tests that fail (roughly a dozen) after the change though if the idea has merit, happy to finish.

If moved forward, would aim for 3.2 / 4.0 or something as it is a relatively API breaking change.

Sorry, pull request has code formatting fixes around it as well. Started tiding that up as well.