public function getObjectAncestry($nameOrObject, $stopAt = null, $removeNamespaces = false)
    {
        $classes = [];
        
        foreach ($this->getReverseAncestry($nameOrObject) as $className) {
            
            if ($removeNamespaces) {
                $classes[] = $this->getClassWithoutNamespace($className);
            } else {
                $classes[] = $className;
            }
            
            if ($className == $stopAt) {
                break;
            }
            
        }
        
        return $classes;
    }