Subversion Repositories computer_asset_manager_v2

Rev

Rev 56 | Rev 63 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

<?php
   require_once( 'camp.class.php' );

   class Device extends Camp {
      protected static $dbStructure = array(
         'table' => array(
            'tableName' => 'device',
            'primaryKey' => 'device_id',
            'selectionDisplay' => 'name',
            'fields' => array(
                  'id' => array (
                     'fieldname' => 'device_id',
                     'displayName' => 'ID',
                     'type' => 'int unsigned',
                     'nullable' => false
                  ),
                  'name' => array (
                     'fieldname' => 'name',
                     'displayName' => 'Name',
                     'type' => 'varchar',
                     'size' => 64,
                     'list' => true
                  ),
                  'uuid' => array (
                     'fieldname' => 'uuid',
                     'displayName' => 'UUID',
                     'type' => 'varchar',
                     'size' => 36,
                     'list' => false
                  ),
                  'serial' => array (
                     'fieldname' => 'serial',
                     'displayName' => 'Serial',
                     'type' => 'varchar',
                     'size' => 36,
                     'list' => false
                  ),
                  'created' => array (
                     'fieldname' => 'created',
                     'displayName' => 'Created',
                     'type' => 'date'
                  ),
                  'removed' => array(
                     'fieldname' => 'removed',
                     'displayName' => 'Removed',
                     'type' => 'date'
                  ),
                  'device_types' => array(
                     'fieldname' => 'device_types',
                     'displayName' => 'Device Type',
                     'type' => 'calculated',
                  ),
                  'parent' => array(
                     'fieldname' => 'parent',
                     'displayName' => 'Parent',
                     'type' => 'calculated',
                     'link' => 'parent_id'
                  ),
                  'parent_id' => array(
                     'fieldname' => 'parent_id',
                     'class' => 'Device',
                     'display' => false,
                     'type' => 'calculated',
                  ),
                  'owner' => array(
                     'fieldname' => 'owner',
                     'displayName' => 'Owner',
                     'type' => 'calculated',
                     'link' => 'owner_id'
                  ),
                  'owner_id' => array(
                     'fieldname' => 'owner_id',
                     'class' => 'Owner',
                     'display' => false,
                     'type' => 'calculated',
                  ),
                  'location' => array(
                     'fieldname' => 'location',
                     'displayName' => 'Location',
                     'type' => 'calculated',
                     'link' => 'location_id'
                  ),
                  'location_id' => array(
                     'fieldname' => 'location_id',
                     'class' => 'Location',
                     'display' => false,
                     'type' => 'calculated',
                  )
               ) // fields
            ), // table
            'view' => array(
               'viewName' => 'view_device_location_owner_type',
               'primaryKey' => 'device_id',
               'selectionDisplay' => 'device',
               'fields' => array(
                  'removed' => array( 
                     'fieldname' => 'device_removed'
                  )
               )
            ), // view
            'children' => array(
            ) // children
         ); // dbStructure

   } // class Device
?>