/**
  * Add Domain Service
  *
  * Add the DomainServiceDBO to the database
  */
 protected function add_domain_service()
 {
     // Prepare DomainServiceDBO for database
     $service_dbo = new DomainServiceDBO();
     $service_dbo->setTLD($this->post['tld']);
     $service_dbo->setModuleName($this->post['modulename']->getName());
     $service_dbo->setDescription($this->post['description']);
     $service_dbo->setPublic(isset($this->post['public']) ? "Yes" : "No");
     // Insert DomainServiceDBO into database
     add_DomainServiceDBO($service_dbo);
     // Hosting Service added
     // Jump to View Domain Service page
     $this->gotoPage("services_edit_domain_service", array(array("type" => "[DOMAIN_SERVICE_ADDED]")), "dservice=" . $service_dbo->getTLD());
 }
/**
 * Load multiple DomainServiceDBO's from database
 *
 * @param string $filter A WHERE clause
 * @param string $sortby Field name to sort results by
 * @param string $sortdir Direction to sort in (ASEC or DESC)
 * @param int $limit Limit the number of results
 * @param int $start Record number to start the results at
 * @return array Array of DomainServiceDBO's
 */
function &load_array_DomainServiceDBO($filter = null, $sortby = null, $sortdir = null, $limit = null, $start = null)
{
    $DB = DBConnection::getDBConnection();
    // Build query
    $sql = $DB->build_select_sql("domainservice", "*", $filter, $sortby, $sortdir, $limit, $start);
    // Run query
    if (!($result = @mysql_query($sql, $DB->handle()))) {
        // Query error
        throw new DBException(mysql_error($DB->handle()));
    }
    if (mysql_num_rows($result) == 0) {
        // No rows found
        throw new DBNoRowsFoundException();
    }
    // Build an array of DBOs from the result set
    $dbo_array = array();
    while ($data = mysql_fetch_array($result)) {
        // Create and initialize a new DBO with the data from the DB
        $dbo = new DomainServiceDBO();
        $dbo->load($data);
        // Add DomainServiceDBO to array
        $dbo_array[] = $dbo;
    }
    return $dbo_array;
}