/** * Creates a new domain under the specified user. * * @param User $user Owner of the domain * @param string $domainName Domain name to create * @param float|null $bandwidthLimit Bandwidth limit in MB, or NULL to share with account * @param float|null $diskLimit Disk limit in MB, or NULL to share with account * @param bool|null $ssl Whether SSL is to be enabled, or NULL to fallback to account default * @param bool|null $php Whether PHP is to be enabled, or NULL to fallback to account default * @param bool|null $cgi Whether CGI is to be enabled, or NULL to fallback to account default * @return Domain The newly created domain */ public static function create(User $user, $domainName, $bandwidthLimit = null, $diskLimit = null, $ssl = null, $php = null, $cgi = null) { $options = ['action' => 'create', 'domain' => $domainName, isset($bandwidthLimit) ? 'bandwidth' : 'ubandwidth' => $bandwidthLimit, isset($diskLimit) ? 'quota' : 'uquota' => $diskLimit, 'ssl' => Conversion::onOff($ssl, $user->hasSSL()), 'php' => Conversion::onOff($php, $user->hasPHP()), 'cgi' => Conversion::onOff($cgi, $user->hasCGI())]; $user->getContext()->invokePost('DOMAIN', $options); $config = $user->getContext()->invokeGet('ADDITIONAL_DOMAINS'); return new self($domainName, $user->getContext(), $config[$domainName]); }
/** * @param bool $newValue Whether catch-all email is enabled for this user */ public function setAllowCatchall($newValue) { $this->modifyConfig(['catchall' => Conversion::onOff($newValue)]); }