1 | <?php |
||
4 | class TitleDataObject extends DataObject |
||
|
|||
5 | { |
||
6 | private static $indexes = array( |
||
7 | 'Title' => 'unique("Title, ClassName")' |
||
8 | ); |
||
9 | |||
10 | private static $searchable_fields = array( |
||
11 | 'Title' => 'PartialMatchFilter' |
||
12 | ); |
||
13 | |||
14 | private static $default_sort = array( |
||
15 | 'Title' => "ASC" |
||
16 | ); |
||
17 | |||
18 | private static $db = array( |
||
19 | 'Title' => 'Varchar(255)', |
||
20 | ); |
||
21 | |||
22 | /** |
||
23 | * to prevent racing conditions ... |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | private static $_cache = array(); |
||
28 | |||
29 | /** |
||
30 | * see README.md for usage ... |
||
31 | * |
||
32 | * @param string $title |
||
33 | * @param bool $showDBAlterationMessage |
||
34 | * @return DataObject |
||
35 | */ |
||
36 | public static function find_or_create($title, $showDBAlterationMessage = false) |
||
71 | } |
||
72 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.