Added more models
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526/site@24 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
29
models/account.php
Normal file
29
models/account.php
Normal 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
models/map.php
Normal file
44
models/map.php
Normal 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
models/maps_unit.php
Normal file
15
models/maps_unit.php
Normal 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
models/site.php
Normal file
41
models/site.php
Normal 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
models/site_area.php
Normal file
34
models/site_area.php
Normal 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
models/unit.php
Normal file
49
models/unit.php
Normal 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
models/unit_size.php
Normal file
44
models/unit_size.php
Normal 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
models/unit_type.php
Normal file
29
models/unit_type.php
Normal 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' => ''
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user