public function setStateEntityType($entityType) { $state = $this->state; if ($state->current->entityType == $entityType) { return; } $state->previous->entityType = $state->current->entityType; $state->current->entityType = $entityType; }