protected function isNewSlugNeeded()
{
if (empty($this->owner->{$this->slugAttribute})) {
return true;
}
if ($this->immutable) {
return false;
}
foreach ((array) $this->attribute as $attribute) {
if ($this->owner->isAttributeChanged($attribute)) {
return true;
}
}
return false;
}