Subversion Repositories computer_asset_manager_v2

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
53 rodolico 1
<?php
2
   require_once( 'camp.class.php' );
3
 
4
   class Location extends Camp {
5
      protected static $dbStructure = array(
6
         'table' => array( 
7
            'tableName' => 'location',
8
            'primaryKey' => 'location_id',
9
            'selectionDisplay' => 'name',
69 rodolico 10
            'inactiveField' => 'removed',
53 rodolico 11
            'fields' => array(
56 rodolico 12
                  'id' => array (
13
                     'fieldname' => 'location_id',
53 rodolico 14
                     'displayName' => 'ID',
15
                     'type' => 'int unsigned',
67 rodolico 16
                     'nullable' => false,
17
                     'canEdit' => false
53 rodolico 18
                  ),
19
                  'name' => array (
56 rodolico 20
                     'fieldname' => 'name',
21
                     'displayName' => 'Location',
53 rodolico 22
                     'type' => 'varchar',
23
                     'size' => 64,
24
                     'list' => true
25
                  ),
63 rodolico 26
                  'uuid' => array (
27
                     'fieldname' => 'uuid',
28
                     'displayName' => 'UUID',
29
                     'type' => 'varchar',
30
                     'size' => 36,
31
                     'list' => false
32
                  ),
53 rodolico 33
                  'created' => array (
56 rodolico 34
                     'fieldname' => 'created',
53 rodolico 35
                     'displayName' => 'Created',
36
                     'type' => 'date'
37
                  ),
38
                  'removed' => array(
56 rodolico 39
                     'fieldname' => 'removed',
53 rodolico 40
                     'displayName' => 'Removed',
41
                     'type' => 'date'
59 rodolico 42
                  ),
67 rodolico 43
                  'owner' => array(
44
                     'fieldname' => 'owner_id',
59 rodolico 45
                     'class' => 'Owner',
64 rodolico 46
                     'displayName' => 'Owner',
69 rodolico 47
                     'displayColumn' => 'name',
64 rodolico 48
                     'type' => '1:1H',
65 rodolico 49
                     'linkageTable' => 'owner_location',
50
                     'linkageColumn' => 'location_id',
51
                     'foreignColumn' => 'owner_id',
52
                     'foreignTable' => 'owner'
59 rodolico 53
                  ),
53 rodolico 54
            ) // fields
56 rodolico 55
         ), // table
56
         'view' => array(
57
            'viewName' => 'view_device_location_owner_type',
58
            'primaryKey' => 'location_id',
59
            'selectionDisplay' => 'location',
60
            'fields' => array(
61
               'removed' => array( 
62
                  'fieldname' => 'location_removed'
63
               )
64
            )
59 rodolico 65
         ), // view
66
         'children' => array(
69 rodolico 67
               'Device' => array(
68
                  'intermediateTable' => 'location_device',
69
                  'remoteID' => 'device_id',
70
                  'myID' => 'location_id'
71
                  )
59 rodolico 72
         ) // children
53 rodolico 73
      ); // dbStructure
59 rodolico 74
 
75
   } // Location
53 rodolico 76
 
77
?>