Enabled caching

This commit is contained in:
Deon George
2011-05-28 19:46:46 +10:00
parent dcd6a54cb9
commit 8b685a84dd
6 changed files with 78 additions and 7 deletions

View File

@@ -168,12 +168,15 @@ class Model_NODE extends ORMTSM {
// Return the volumes that this node uses
// $dtype is BACKUP or ARCHIVE
// @todo Cache this data
public function volumes($dtype) {
$volumes = array();
$v = array();
foreach ($this->VOLUMEUSAGE->where('COPY_TYPE','=',$dtype)->order_by('STGPOOL_NAME,FILESPACE_NAME')->find_all() as $vol)
$volumes[$vol->STGPOOL_NAME][] = $vol->VOLUME;
if (! in_array($vol->VOLUME->VOLUME_NAME,$v)) {
$volumes[$vol->STGPOOL_NAME][] = $vol->VOLUME;
array_push($v,$vol->VOLUME->VOLUME_NAME);
}
return $volumes;
}