oinInner( array('d' => 'domains'), '(d.id = ds.dom_id AND d.webspace_id = 0) or (d.webspace_id = ds.dom_id AND d.webspace_id != 0)', null ) ->where('d.id = ?', $domainId); $serviceNode = $this->fetchRow($select); if (null === $serviceNode) { if ($type === self::TYPE_MAIL) { // workaround for upgrade: in some cases there is no separate IP for service mail, // at that cases we should use local service node return $this->getManagementNode(); } return null; } return $this->_getCached($serviceNode, $cacheKey); } /** * Get web hosting service node by domain id * resolve service not by ip address specified in domain service web * * @param int $domainId * @return Db_Table_Row_ServiceNode */ public function getWebHostingServiceNodeByDomainId($domainId) { return $this->_getServiceNodeByTypeAndDomainId(self::TYPE_WEB, $domainId); } /** * Get web hosting service node by domain name * resolve service not by ip address specified in domain service web * * @param string $domainName * @return Db_Table_Row_ServiceNode */ public function getWebHostingServiceNodeByDomainName($domainName) { /** @var Db_Table_Broker_Domains $domainsBroker */ $domainsBroker = Db_Table_Broker::get('domains'); $domain = $domainsBroker->getDomainByName($domainName); if (!$domain) { return null; } $domainId = $domain->id; return $this->_getServiceNodeByTypeAndDomainId(self::TYPE_WEB, $domainId); } /** * Get web statistics service node by domain id * * @param int $domainId * @return Db_Table_Row_ServiceNode */ public function getWebStatisticsServiceNodeByDomainId($domainId) { return $this->getWebHostingServiceNodeByDomainId($domainId); } /** * Get mail service node by domain id * use local for now * * @param int $domainId * @return Db_Table_Row_ServiceNode */ public function getMailServiceNodeByDomainId($domainId) { return $this->_getServiceNodeByTypeAndDomainId(self::TYPE_MAIL, $do