public function save(PropelPDO $con = null) { if ($this->physicalvolumes !== null) { foreach ($this->physicalvolumes as $physicalvol) { $etva_vg_phy = EtvaVolumePhysicalPeer::retrieveByVGPV($this->getId(), $physicalvol->getId()); if (!$etva_vg_phy) { $etva_vg_phy = new EtvaVolumePhysical(); } $etva_vg_phy->setEtvaPhysicalvolume($physicalvol); $this->addEtvaVolumePhysical($etva_vg_phy); } } parent::save($con); }
public function unregister(EtvaNode $etva_node) { $etva_volgroup = $this->etva_vg; /* * delete pvs with vg */ $etva_volgroup_physical_list = EtvaVolumePhysicalPeer::getByEtvaVolumeGroupId($etva_volgroup->getId()); foreach ($etva_volgroup_physical_list as $etva_volgroup_physical) { $etva_physical = $etva_volgroup_physical->getEtvaPhysicalvolume(); $etva_volgroup_physical->delete(); $etva_physical->delete(); } /* * delete lvs with vg */ $etva_logicalvolumes_list = EtvaLogicalVolumePeer::getByEtvaVolumeGroupId($etva_volgroup->getId()); foreach ($etva_logicalvolumes_list as $etva_logicalvolume) { $etva_logicalvolume->delete(); } // delete it $etva_volgroup->delete(); return array('success' => true); }