protected function getParentClasses(string $name) : array
    {
        // Collect parent classes, ignoring transient (not-mapped) classes.
        $parentClasses = [];

        $parentClasses = $this->getReflectionService()
            ->getParentClasses($name);

        foreach (array_reverse($parentClasses) as $parentClass) {
            if ($this->getDriver()->isTransient($parentClass)) {
                continue;
            }

            $parentClasses[] = $parentClass;
        }

        return $parentClasses;
    }