public function hasSubscriber() { if (DomainSubscriptionsTable::getInstance()->findOneBy("domain_profile_id", $this->getId())) { return true; } return false; }
public function executeUnsubscribe_api(sfWebRequest $request) { $this->getResponse()->setContentType('application/json'); //$lUrl = $request->getParameter('ep-url'); $lHostId = $request->getParameter('host_id'); $lDomainProfile = Doctrine::getTable('DomainProfile')->find($lHostId); $lEndpoint = DomainSubscriptionsTable::getInstance()->findOneBy("domain_profile_id", $lDomainProfile->getId()); $lEndpoint->delete(); return $this->renderText(json_encode(array('success' => true, 'msg' => _('Subscription stopped'), 'row' => $this->getPartial('domain_profiles/domain_profiles_row_content', array('domain_profile' => $lDomainProfile, 'pHasError' => false)), 'host_id' => $lDomainProfile->getId()))); }