I'm looking to loop through a set of data objects, but I need to filter out those that the current time has not passed the 'publish date" field I created. Normally, I would do this when I run my DataObject::Get('ObjectName') method, and just use the '->Filter()' method to do so. But I was wondering if I can set it within the DataModel itself. Similar to how if you had a field "Title", you could implement a method:
static $db = array (
'Title' => 'Varchar(255)'
)
public function getTitle() {
//perform modifications
return $this->Title;
}
So within the same data model, it will only return itself, if it passes validation. Rather than just filtering every time I call it through a loop.