DOCS Fix DataObject examples

This commit is contained in:
Nicola Fontana 2022-07-15 06:38:43 +02:00
parent 2262d84a73
commit d65ba0d718

View File

@ -4023,9 +4023,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* identified by their class name (extending from {@link SS_Database}). * identified by their class name (extending from {@link SS_Database}).
* *
* <code> * <code>
* array( * private static $create_table_options = [
* 'MySQLDatabase' => 'ENGINE=MyISAM' * MySQLSchemaManager::ID => 'ENGINE=MyISAM',
* ) * ];
* </code> * </code>
* *
* Caution: This API is experimental, and might not be * Caution: This API is experimental, and might not be
@ -4069,10 +4069,12 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* behaviour such as publishing and ParentNodes. * behaviour such as publishing and ParentNodes.
* *
* Example: * Example:
* array( * <code>
* array('Title' => "DefaultPage1", 'PageTitle' => 'page1'), * private static $default_records = [
* array('Title' => "DefaultPage2") * [ 'Title' => 'DefaultPage1', 'PageTitle' => 'page1' ],
* ). * [ 'Title' => 'DefaultPage2' ],
* ];
* </code>
* *
* @var array * @var array
* @config * @config
@ -4131,11 +4133,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* *
* Example code: * Example code:
* <code> * <code>
* public static $many_many_extraFields = array( * private static $many_many_extraFields = [
* 'Members' => array( * 'Members' => [
* 'Role' => 'Varchar(100)' * 'Role' => 'Varchar(100)',
* ) * ],
* ); * ];
* </code> * </code>
* *
* @var array * @var array
@ -4165,31 +4167,31 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
* *
* Overriding the default filter, with a custom defined filter: * Overriding the default filter, with a custom defined filter:
* <code> * <code>
* static $searchable_fields = array( * private static $searchable_fields = [
* "Name" => "PartialMatchFilter" * 'Name' => 'PartialMatchFilter',
* ); * ];
* </code> * </code>
* *
* Overriding the default form fields, with a custom defined field. * Overriding the default form fields, with a custom defined field.
* The 'filter' parameter will be generated from {@link DBField::$default_search_filter_class}. * The 'filter' parameter will be generated from {@link DBField::$default_search_filter_class}.
* The 'title' parameter will be generated from {@link DataObject->fieldLabels()}. * The 'title' parameter will be generated from {@link DataObject->fieldLabels()}.
* <code> * <code>
* static $searchable_fields = array( * private static $searchable_fields = [
* "Name" => array( * 'Name' => [
* "field" => "TextField" * 'field' => 'TextField',
* ) * ],
* ); * ];
* </code> * </code>
* *
* Overriding the default form field, filter and title: * Overriding the default form field, filter and title:
* <code> * <code>
* static $searchable_fields = array( * private static $searchable_fields = [
* "Organisation.ZipCode" => array( * 'Organisation.ZipCode' => [
* "field" => "TextField", * 'field' => 'TextField',
* "filter" => "PartialMatchFilter", * 'filter' => 'PartialMatchFilter',
* "title" => 'Organisation ZIP' * 'title' => 'Organisation ZIP',
* ) * ],
* ); * ];
* </code> * </code>
* @config * @config
* @var array * @var array