git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@797 97e9348a-65ac-dc4b-aefc-98561f571b83
37 lines
900 B
PHP
37 lines
900 B
PHP
<?php
|
|
class Site extends AppModel {
|
|
|
|
var $hasMany =
|
|
array('SiteArea',
|
|
'SiteOption',
|
|
'Membership',
|
|
);
|
|
|
|
static $current_site_id;
|
|
|
|
function currentSiteId() {
|
|
if (!empty(self::$current_site_id))
|
|
return self::$current_site_id;
|
|
|
|
// REVISIT <AP>: 20090827
|
|
// Must get the actual site
|
|
$code = 'VSS';
|
|
|
|
$site = $this->find
|
|
('first',
|
|
array('recursive' => -1,
|
|
'conditions' => compact('code')));
|
|
|
|
if (!empty($site['Site']['id']))
|
|
self::$current_site_id = $site['Site']['id'];
|
|
else
|
|
// We must force a stop here, since this is typically
|
|
// called very early on, and so will cause a recursive
|
|
// crash as we try to render the internal error and
|
|
// again stumble on this problem.
|
|
$this->INTERNAL_ERROR('UNKNOWN SITE', 0, true);
|
|
|
|
return self::$current_site_id;
|
|
}
|
|
}
|
|
?>
|