SHARE
TWEET

Untitled

a guest Aug 31st, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. namespace CityOnAHill\Model\Inventory;
  3.  
  4. use SilverStripe\Admin\ModelAdmin;
  5.  
  6. class InventoryAdmin extends ModelAdmin{
  7.     private static $menu_title = 'Inventory';
  8.     private static $url_segment = 'inventory';
  9.     private static $managed_models = [
  10.         StorageLocation::class,
  11.         Box::class,
  12.         InvObject::class
  13.     ];
  14. }
  15.  
  16. ###########
  17.  
  18. <?php
  19. namespace CityOnAHill\Model\Inventory;
  20.  
  21. use SilverStripe\ORM\DataObject;
  22. use SilverStripe\Assets\Image;
  23.  
  24. class StorageLocation extends DataObject{
  25.     private static $table_name = "Inventory_StorageLocation";
  26.     private static $db =[
  27.         'Title' => 'Varchar'
  28.     ];
  29.     private static $has_one = [
  30.         'Image' => Image::class
  31.     ];
  32.     private static $has_many = [
  33.         'Boxes' => Box::class
  34.     ];
  35. }
  36. ?>
  37.  
  38.  
  39. ##########
  40.  
  41. <?php
  42. namespace CityOnAHill\Model\Inventory;
  43.  
  44. use SilverStripe\ORM\DataObject;
  45. use SilverStripe\Assets\Image;
  46.  
  47.  
  48. class Box extends DataObject{
  49.     private static $table_name = "Inventory_Box";
  50.     private static $db =[
  51.         'Number' => 'Int',
  52.         'Services' => 'MultiEnum(array("Morning", "Night"))',
  53.         'Note' => 'Text',
  54.         'Restock' => 'Boolean'
  55.     ];
  56.    
  57.     private static $has_one = [
  58.         'StorageLocation' => StorageLocation::class
  59.     ];
  60.    
  61.     private static $has_many = [
  62.         'Objects' => InvObject::class
  63.     ];
  64.    
  65.     private static $plural_name = "Boxes";
  66. }
  67.  
  68.  
  69. ?>
  70.  
  71. ##########
  72.  
  73. <?php
  74. namespace CityOnAHill\Model\Inventory;
  75.  
  76. use SilverStripe\ORM\DataObject;
  77. use SilverStripe\Assets\Image;
  78.  
  79.  
  80. class Box extends DataObject{
  81.     private static $table_name = "Inventory_Box";
  82.     private static $db =[
  83.         'Number' => 'Int',
  84.         'Services' => 'MultiEnum(array("Morning", "Night"))',
  85.         'Note' => 'Text',
  86.         'Restock' => 'Boolean'
  87.     ];
  88.    
  89.     private static $has_one = [
  90.         'StorageLocation' => StorageLocation::class
  91.     ];
  92.    
  93.     private static $has_many = [
  94.         'Objects' => InvObject::class
  95.     ];
  96.    
  97.     private static $plural_name = "Boxes";
  98. }
  99.  
  100.  
  101. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top