Silverstripe: Boolean Value Converter to Readable

Here is the solution for convert boolean value to be readable: Add a function to convert the value to Yes or No in your DataObject class, then refer to the function instead of the DB field when defining the DOM or in your $summary_fields.

Continue reading


Silverstripe: DataObject Compare Date

We want to show the events which key date are after the current date. Below function is not correct.

The where clause is MySQL. MySQL has a function CURDATE() that returns the DATE part of the current time, so no need to generate it yourself. Also, date is a reserved sql word, so it […]

Continue reading