with(['zone.domain'])->cursor() as $o) { // Trim the role bit from role, since we now work out a role automatically. // @todo This doesnt work, because role_id returns back the overridden role, and thus would remove it if (($o->role & Address::NODE_ALL) === $o->role_id) { $o->role &= ~$o->role_id; if ((! $o->role) || ($o->role === Address::NODE_UNKNOWN)) $o->role = NULL; if ($o->getDirty()) if ($this->option('fix')) { $o->save(); } else { $this->warn(sprintf('Not changing [%s](%s) from [%d] to [%d]',$o->ftn,$o->role_name,$o->getOriginal('role'),$o->role)); } } } } }