Added more models

git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@24 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-05-28 09:27:29 +00:00
parent 7433e6868c
commit aed2c6912c
8 changed files with 285 additions and 0 deletions

29
site/models/account.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
class Account extends AppModel {
var $name = 'Account';
var $validate = array(
'id' => array('numeric'),
'name' => array('notempty'),
'external_name' => array('notempty')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'ChargeType' => array(
'className' => 'ChargeType',
'foreignKey' => 'account_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
}
?>

44
site/models/map.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
class Map extends AppModel {
var $name = 'Map';
var $validate = array(
'id' => array('numeric'),
'site_id' => array('numeric'),
'site_area_id' => array('numeric'),
'name' => array('notempty'),
'width' => array('numeric'),
'depth' => array('numeric')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'SiteArea' => array(
'className' => 'SiteArea',
'foreignKey' => 'site_area_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
var $hasAndBelongsToMany = array(
'Unit' => array(
'className' => 'Unit',
'joinTable' => 'maps_units',
'foreignKey' => 'map_id',
'associationForeignKey' => 'unit_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);
}
?>

15
site/models/maps_unit.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
class MapsUnit extends AppModel {
var $name = 'MapsUnit';
var $validate = array(
'id' => array('numeric'),
'map_id' => array('numeric'),
'unit_id' => array('numeric'),
'pt_top' => array('numeric'),
'pt_left' => array('numeric'),
'transpose' => array('boolean')
);
}
?>

41
site/models/site.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
class Site extends AppModel {
var $name = 'Site';
var $validate = array(
'id' => array('numeric'),
'name' => array('notempty')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'SiteArea' => array(
'className' => 'SiteArea',
'foreignKey' => 'site_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
'SiteOption' => array(
'className' => 'SiteOption',
'foreignKey' => 'site_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
}
?>

34
site/models/site_area.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
class SiteArea extends AppModel {
var $name = 'SiteArea';
var $validate = array(
'id' => array('numeric'),
'site_id' => array('numeric'),
'name' => array('notempty')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Site' => array(
'className' => 'Site',
'foreignKey' => 'site_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
var $hasOne = array(
'Map' => array(
'className' => 'Map',
'foreignKey' => 'site_area_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => ''
)
);
}
?>

49
site/models/unit.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
class Unit extends AppModel {
var $name = 'Unit';
var $validate = array(
'id' => array('numeric'),
'unit_size_id' => array('numeric'),
'name' => array('notempty'),
'sort_order' => array('numeric'),
'walk_order' => array('numeric'),
'deposit' => array('money'),
'amount' => array('money')
);
var $belongsTo = array(
'UnitSize' => array(
'className' => 'UnitSize',
'foreignKey' => 'unit_size_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
/* 'Map' => array( */
/* 'className' => 'MapsUnit', */
/* 'foreignKey' => 'unit_id', */
/* 'conditions' => '', */
/* 'fields' => '', */
/* 'order' => '' */
/* ) */
);
var $hasMany = array(
'Lease' => array(
'className' => 'Lease',
'foreignKey' => 'unit_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
}
?>

44
site/models/unit_size.php Normal file
View File

@@ -0,0 +1,44 @@
<?php
class UnitSize extends AppModel {
var $name = 'UnitSize';
var $validate = array(
'id' => array('numeric'),
'unit_type_id' => array('numeric'),
'code' => array('notempty'),
'name' => array('notempty'),
'width' => array('numeric'),
'depth' => array('numeric'),
'deposit' => array('money'),
'amount' => array('money')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'UnitType' => array(
'className' => 'UnitType',
'foreignKey' => 'unit_type_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
var $hasMany = array(
'Unit' => array(
'className' => 'Unit',
'foreignKey' => 'unit_size_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
}
?>

29
site/models/unit_type.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
class UnitType extends AppModel {
var $name = 'UnitType';
var $validate = array(
'id' => array('numeric'),
'code' => array('notempty'),
'name' => array('notempty')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'UnitSize' => array(
'className' => 'UnitSize',
'foreignKey' => 'unit_type_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
}
?>