findOneByName("Power Alarms"); if ($abm == NULL) { // Create Standard Alarm Balance Monitor $abm = new AlarmBalanceMonitor(); $abm->setName("Power Alarms"); $abm->setUncfdAstaBal(new AlarmBalance(5)); $abm->setCfdAstaBal(new AlarmBalance(3)); $abm->setEvtSelMode(new SelectMode(2)); $abm->save(); } $abm = AlarmBalanceMonitorQuery::create()->findOneByName("Facility Alarms"); if ($abm == NULL) { // Create Standard Alarm Balance Monitor $abm = new AlarmBalanceMonitor(); $abm->setName("Facility Alarms"); $abm->setUncfdAstaBal(new AlarmBalance(7)); $abm->setCfdAstaBal(new AlarmBalance(4)); $abm->setEvtSelMode(new SelectMode(2)); $abm->save(); } //create bes $aed = AlarmEventDescriptorQuery::create()->findOneByEvtSpecVal("1.2.3.4.2.4.6.2.1"); $bes = BalancingEventSelectorQuery::create()->findOneByAedId($aed->getId()); if ($bes == null) { $bes = new BalancingEventSelector(); $bes->setAbmId($abm->getId()); $bes->setAedId($aed->getId()); $bes->save(); }