public function getByName($name) { $c = new Criteria(); $c->add(NagiosServiceTemplatePeer::NAME, $name); $c->setIgnoreCase(true); $template = NagiosServiceTemplatePeer::doSelectOne($c); if (!$template) { return false; } return $template; }
/** * Get the associated NagiosServiceTemplate object * * @param PropelPDO Optional Connection object. * @return NagiosServiceTemplate The associated NagiosServiceTemplate object. * @throws PropelException */ public function getNagiosServiceTemplateRelatedByTargetTemplate(PropelPDO $con = null) { if ($this->aNagiosServiceTemplateRelatedByTargetTemplate === null && $this->target_template !== null) { $c = new Criteria(NagiosServiceTemplatePeer::DATABASE_NAME); $c->add(NagiosServiceTemplatePeer::ID, $this->target_template); $this->aNagiosServiceTemplateRelatedByTargetTemplate = NagiosServiceTemplatePeer::doSelectOne($c, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aNagiosServiceTemplateRelatedByTargetTemplate->addNagiosServiceTemplateInheritancesRelatedByTargetTemplate($this); */ } return $this->aNagiosServiceTemplateRelatedByTargetTemplate; }