Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | class Domain extends Model | ||||
/** | /** | ||||
* Returns whether this domain is active. | * Returns whether this domain is active. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isActive(): bool | public function isActive(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_ACTIVE) == true; | return ($this->status & self::STATUS_ACTIVE) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is confirmed the ownership of. | * Returns whether this domain is confirmed the ownership of. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isConfirmed(): bool | public function isConfirmed(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_CONFIRMED) == true; | return ($this->status & self::STATUS_CONFIRMED) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is deleted. | * Returns whether this domain is deleted. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isDeleted(): bool | public function isDeleted(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_DELETED) == true; | return ($this->status & self::STATUS_DELETED) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is registered with us. | * Returns whether this domain is registered with us. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isExternal(): bool | public function isExternal(): bool | ||||
{ | { | ||||
return ($this->type & self::TYPE_EXTERNAL) == true; | return ($this->type & self::TYPE_EXTERNAL) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is hosted with us. | * Returns whether this domain is hosted with us. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isHosted(): bool | public function isHosted(): bool | ||||
{ | { | ||||
return ($this->type & self::TYPE_HOSTED) == true; | return ($this->type & self::TYPE_HOSTED) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is new. | * Returns whether this domain is new. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isNew(): bool | public function isNew(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_NEW) == true; | return ($this->status & self::STATUS_NEW) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is public. | * Returns whether this domain is public. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isPublic(): bool | public function isPublic(): bool | ||||
{ | { | ||||
return ($this->type & self::TYPE_PUBLIC) == true; | return ($this->type & self::TYPE_PUBLIC) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is registered in LDAP. | * Returns whether this domain is registered in LDAP. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isLdapReady(): bool | public function isLdapReady(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_LDAP_READY) == true; | return ($this->status & self::STATUS_LDAP_READY) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this domain is suspended. | * Returns whether this domain is suspended. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isSuspended(): bool | public function isSuspended(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_SUSPENDED) == true; | return ($this->status & self::STATUS_SUSPENDED) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this (external) domain has been verified | * Returns whether this (external) domain has been verified | ||||
* to exist in DNS. | * to exist in DNS. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isVerified(): bool | public function isVerified(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_VERIFIED) == true; | return ($this->status & self::STATUS_VERIFIED) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Domain status mutator | * Domain status mutator | ||||
* | * | ||||
* @throws \Exception | * @throws \Exception | ||||
*/ | */ | ||||
public function setStatusAttribute($status) | public function setStatusAttribute($status) | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |