function SelectDomainByX($xvalue, $xtype) { $return = null; switch ($xtype) { case 'id': if (!$this->_connector->Execute($this->_commandCreator->SelectDomainById($xvalue))) { return $return; } break; case 'name': if (!$this->_connector->Execute($this->_commandCreator->SelectDomainByName($xvalue))) { return $return; } break; default: return $return; break; } $row = $this->_connector->GetNextRecord(); if ($row) { $return = new CWebMailDomain(); $return->InitByDbRow($row); } return $return; }