37 lines
934 B
PHP
Executable file
37 lines
934 B
PHP
Executable file
<?php
|
|
|
|
require_once 'om/BaseNagiosContactGroup.php';
|
|
|
|
|
|
/**
|
|
* Skeleton subclass for representing a row from the 'nagios_contact_group' table.
|
|
*
|
|
* Nagios Contact Group
|
|
*
|
|
* This class was autogenerated by Propel on:
|
|
*
|
|
* Thu Dec 13 21:25:24 2007
|
|
*
|
|
* You should add additional methods to this class to meet the
|
|
* application requirements. This class will only be generated as
|
|
* long as it does not already exist in the output directory.
|
|
*
|
|
* @package
|
|
*/
|
|
class NagiosContactGroup extends BaseNagiosContactGroup {
|
|
|
|
public function addMemberByName($name) {
|
|
$c = new Criteria();
|
|
$c->add(NagiosContactPeer::NAME, $name);
|
|
$contact = NagiosContactPeer::doSelectOne($c);
|
|
if(!empty($contact)) {
|
|
$membership = new NagiosContactGroupMember();
|
|
$membership->setNagiosContactGroup($this);
|
|
$membership->setNagiosContact($contact);
|
|
$membership->save();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
} // NagiosContactGroup
|