dynamic /
silverstripe-salsify
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Dynamic\Salsify\Tests\TestOnly; |
||
| 4 | |||
| 5 | use SilverStripe\Assets\Image; |
||
| 6 | use SilverStripe\Dev\TestOnly; |
||
| 7 | use SilverStripe\ORM\DataObject; |
||
| 8 | use SilverStripe\ORM\ManyManyList; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class MappedObject |
||
| 12 | * @package Dynamic\Salsify\Tests\TestOnly |
||
| 13 | * |
||
| 14 | * @property string Unique |
||
| 15 | * @property string Title |
||
| 16 | * @property string Seller |
||
| 17 | * @property string Modified |
||
| 18 | * @property string FallbackString |
||
| 19 | * @property string FallbackArray |
||
| 20 | * |
||
| 21 | * @property int MainImageID |
||
| 22 | * @method Image MainImage |
||
| 23 | * |
||
| 24 | * @method ManyManyList Images |
||
| 25 | */ |
||
| 26 | class MappedObject extends DataObject implements TestOnly |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | private static $table_name = 'MappedObject'; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 32 | |||
| 33 | /** |
||
| 34 | * @var array |
||
| 35 | */ |
||
| 36 | private static $db = [ |
||
|
0 ignored issues
–
show
|
|||
| 37 | 'Unique' => 'Varchar', |
||
| 38 | 'Title' => 'Varchar', |
||
| 39 | 'Seller' => 'Varchar', |
||
| 40 | 'Modified' => 'Varchar', |
||
| 41 | 'FallbackString' => 'Varchar', |
||
| 42 | 'FallbackArray' => 'Varchar', |
||
| 43 | ]; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @var array |
||
| 47 | */ |
||
| 48 | private static $has_one = [ |
||
|
0 ignored issues
–
show
|
|||
| 49 | 'MainImage' => Image::class, |
||
| 50 | ]; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var array |
||
| 54 | */ |
||
| 55 | private static $many_many = [ |
||
|
0 ignored issues
–
show
|
|||
| 56 | 'Images' => Image::class, |
||
| 57 | ]; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @var array |
||
| 61 | */ |
||
| 62 | private static $many_many_extraFields = [ |
||
|
0 ignored issues
–
show
|
|||
| 63 | 'Images' => [ |
||
| 64 | 'SortOrder' => 'Int', |
||
| 65 | ], |
||
| 66 | ]; |
||
| 67 | } |
||
| 68 |