public function onAfterWrite()
{
parent::onAfterWrite();
if ($this->Usage === self::PRODUCTION || $this->Usage === self::UAT) {
$conflicting = DNEnvironment::get()->filter('ProjectID', $this->ProjectID)->filter('Usage', $this->Usage)->exclude('ID', $this->ID);
foreach ($conflicting as $otherEnvironment) {
$otherEnvironment->Usage = self::UNSPECIFIED;
$otherEnvironment->write();
}
}
}