I'm using instructions form page http://docs.silverstripe.org/en/3.1/developer_guides/search/searchcontext/
I've got code:
<?php
class MyDataObject extends DataObject {
private static $db = array(
'PublicProperty' => 'Text'
'HiddenProperty' => 'Text',
'MyDate' => 'Int'
);
public function getCustomSearchContext() {
$fields = $this->scaffoldSearchFields(array(
'restrictFields' => array('PublicProperty','MyDate')
));
$filters = array(
'PublicProperty' => new PartialMatchFilter('PublicProperty'),
'MyDate' => new GreaterThanFilter('MyDate')
);
return new SearchContext(
$this->class,
$fields,
$filters
);
}
}
My questions are:
1. How can I add next field as bellow:
'MyDate' => new LessThanFilter('MyDate') ?
I added this but without effects. Maybe is other solution to make field with values from to?
2. How can I change labels name?