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',
10
            'fields' => array(
56 rodolico 11
                  'id' => array (
12
                     'fieldname' => 'location_id',
53 rodolico 13
                     'displayName' => 'ID',
14
                     'type' => 'int unsigned',
15
                     'nullable' => false
16
                  ),
17
                  'name' => array (
56 rodolico 18
                     'fieldname' => 'name',
19
                     'displayName' => 'Location',
53 rodolico 20
                     'type' => 'varchar',
21
                     'size' => 64,
22
                     'list' => true
23
                  ),
24
                  'created' => array (
56 rodolico 25
                     'fieldname' => 'created',
53 rodolico 26
                     'displayName' => 'Created',
27
                     'type' => 'date'
28
                  ),
29
                  'removed' => array(
56 rodolico 30
                     'fieldname' => 'removed',
53 rodolico 31
                     'displayName' => 'Removed',
32
                     'type' => 'date'
59 rodolico 33
                  ),
34
                  'location_owner' => array(
35
                     'fieldname' => 'location_owner',
36
                     'displayName' => 'Owner',
37
                     'type' => 'calculated',
38
                     'link' => 'owner_id'
39
                  ),
40
                  'location_owner_id' => array(
41
                     'fieldname' => 'location_owner_id',
42
                     'class' => 'Owner',
43
                     'display' => false,
44
                     'type' => 'calculated',
45
                  ),
53 rodolico 46
            ) // fields
56 rodolico 47
         ), // table
48
         'view' => array(
49
            'viewName' => 'view_device_location_owner_type',
50
            'primaryKey' => 'location_id',
51
            'selectionDisplay' => 'location',
52
            'fields' => array(
53
               'removed' => array( 
54
                  'fieldname' => 'location_removed'
55
               )
56
            )
59 rodolico 57
         ), // view
58
         'children' => array(
59
            'Device'
60
         ) // children
53 rodolico 61
      ); // dbStructure
59 rodolico 62
 
63
      public function __construct( $id ) {
64
         parent::__construct( $id );
65
         print "<pre>" . print_r( $this->data, true ) . '</pre>';
66
      }
67
   } // Location
53 rodolico 68
 
69
?>