Pheasant\Migrate\Enumerator::_getDomainObjectsFromFile PHP Method

_getDomainObjectsFromFile() private method

Finds classes that extend \Pheasant\DomainObject
private _getDomainObjectsFromFile ( $file )
    private function _getDomainObjectsFromFile($file)
    {
        $result = array();
        if (fnmatch("*.php", $file)) {
            foreach ($this->_getClassFiles($file) as $namespace => $classes) {
                foreach ($classes as $class) {
                    $fullClass = empty($namespace) ? "\\{$class}" : "\\{$namespace}\\{$class}";
                    $reflection = new \ReflectionClass($fullClass);
                    if (is_a($fullClass, "\\Pheasant\\DomainObject", true) && $reflection->isInstantiable()) {
                        $result[] = $fullClass;
                    }
                }
            }
        }
        return $result;
    }