Overview
  • Namespace
  • Class

Namespaces

  • Omines
    • DirectAdmin
      • Context
      • Objects
        • Database
        • Domains
        • Email
        • Users
      • Utility

Classes

  • BaseObject
  • Database
  • Domain
  • DomainObject

Class Domain

Encapsulates a domain and its derived objects, like aliases, pointers and mailboxes.

Omines\DirectAdmin\Objects\BaseObject
Extended by Omines\DirectAdmin\Objects\Domain
Namespace: Omines\DirectAdmin\Objects
Author: Niels Keurentjes niels.keurentjes@omines.com
Located at DirectAdmin/Objects/Domain.php

Methods summary

public
# __construct( string $name, Omines\DirectAdmin\Context\UserContext $context, string|array $config )

Construct the object.

Construct the object.

Parameters

$name
The domain name
$context
The owning user context
$config
The basic config string as returned by CMD_API_ADDITIONAL_DOMAINS

Overrides

Omines\DirectAdmin\Objects\BaseObject::__construct
public static Omines\DirectAdmin\Objects\Domain
# create( Omines\DirectAdmin\Objects\Users\User $user, string $domainName, float|null $bandwidthLimit = null, float|null $diskLimit = null, boolean|null $ssl = null, boolean|null $php = null, boolean|null $cgi = null )

Creates a new domain under the specified user.

Creates a new domain under the specified user.

Parameters

$user
Owner of the domain
$domainName
Domain name to create
$bandwidthLimit
Bandwidth limit in MB, or NULL to share with account
$diskLimit
Disk limit in MB, or NULL to share with account
$ssl
Whether SSL is to be enabled, or NULL to fallback to account default
$php
Whether PHP is to be enabled, or NULL to fallback to account default
$cgi
Whether CGI is to be enabled, or NULL to fallback to account default

Returns

Omines\DirectAdmin\Objects\Domain
The newly created domain
public Omines\DirectAdmin\Objects\Email\Forwarder
# createForwarder( string $prefix, string|string[] $recipients )

Creates a new email forwarder.

Creates a new email forwarder.

Parameters

$prefix
Part of the email address before the @
$recipients
One or more recipients

Returns

Omines\DirectAdmin\Objects\Email\Forwarder
The newly created forwarder
public Omines\DirectAdmin\Objects\Email\Mailbox
# createMailbox( string $prefix, string $password, integer|null $quota = null, integer|null $sendLimit = null )

Creates a new mailbox.

Creates a new mailbox.

Parameters

$prefix
Prefix for the account
$password
Password for the account
$quota
Quota in megabytes, or zero/null for unlimited
$sendLimit
Send limit, or 0 for unlimited, or null for system default

Returns

Omines\DirectAdmin\Objects\Email\Mailbox
The newly created mailbox
public
# createPointer( string $domain, boolean $alias = false )

Creates a pointer or alias.

Creates a pointer or alias.

Parameters

$domain
$alias
public Omines\DirectAdmin\Objects\Domains\Subdomain
# createSubdomain( string $prefix )

Creates a new subdomain.

Creates a new subdomain.

Parameters

$prefix
Prefix to add before the domain name

Returns

Omines\DirectAdmin\Objects\Domains\Subdomain
The newly created subdomain
public
# delete( )

Deletes this domain from the user.

Deletes this domain from the user.

public string[]
# getAliases( )

Returns

string[]
List of aliases for this domain
public float
# getBandwidthUsed( )

Returns

float
Bandwidth used in megabytes
public float|null
# getBandwidthLimit( )

Returns

float|null
Bandwidth quotum in megabytes, or NULL for unlimited
public string|null
# getCatchall( )

Returns

string|null
Currently configured catch-all configuration
public float
# getDiskUsage( )

Returns

float
Disk usage in megabytes
public string
# getDomainName( )

Returns

string
The real domain name
public string[]
# getDomainNames( )

Returns unified sorted list of main domain name, aliases and pointers.

Returns unified sorted list of main domain name, aliases and pointers.

Returns

string[]
public Omines\DirectAdmin\Objects\Email\Forwarder[]
# getForwarders( )

Returns

Omines\DirectAdmin\Objects\Email\Forwarder[]
Associative array of forwarders
public Omines\DirectAdmin\Objects\Email\Mailbox[]
# getMailboxes( )

Returns

Omines\DirectAdmin\Objects\Email\Mailbox[]
Associative array of mailboxes
public Omines\DirectAdmin\Objects\Users\User
# getOwner( )

Returns

Omines\DirectAdmin\Objects\Users\User
public string[]
# getPointers( )

Returns

string[]
List of domain pointers for this domain
public Omines\DirectAdmin\Objects\Domains\Subdomain[]
# getSubdomains( )

Returns

Omines\DirectAdmin\Objects\Domains\Subdomain[]
Associative array of subdomains
public array
# invokePost( string $command, string $action, array $parameters = [], boolean $clearCache = true )

Invokes a POST command on a domain object.

Invokes a POST command on a domain object.

Parameters

$command
Command to invoke
$action
Action to execute
$parameters
Additional options for the command
$clearCache
Whether to clear the domain cache on success

Returns

array
Response from the API
public
# setCatchall( string $newValue )

Parameters

$newValue
New address for the catch-all, or one of the CATCHALL_ constants
public string
# __toString( )

Allows Domain object to be passed as a string with its domain name.

Allows Domain object to be passed as a string with its domain name.

Returns

string

Methods inherited from Omines\DirectAdmin\Objects\BaseObject

clearCache(), getCache(), getCacheItem(), getContext(), getName(), setCache(), toObjectArray(), toRichObjectArray()

Constants summary

string CACHE_FORWARDERS
# 'forwarders'
string CACHE_MAILBOXES
# 'mailboxes'
string CACHE_SUBDOMAINS
# 'subdomains'
string CATCHALL_BLACKHOLE
# ':blackhole:'
string CATCHALL_FAIL
# ':fail:'
API documentation generated by ApiGen