private function importDefinitionsFromDirectory(array $overrideData)
    {
        if (!file_exists($this->path)) {
            throw new \Exception('Directory not found: ' . $this->path);
        }

        // Grab all yaml files in the schema directory.
        $schemaFiles = preg_grep('~\.(yml)$~', scandir($this->path));

        // Read contents of each file and add it to the definitions.
        foreach ($schemaFiles as $fileName) {
            $schemaStructure = explode('.', $this->fromSafeFileName($fileName));
            $dataTypeHandle = $schemaStructure[0];
            $recordName = $schemaStructure[1];

            $definition = Data::parseYamlFile($this->path . $fileName);

            // Check if there is data in the override file for the current record.
            if (isset($overrideData[$dataTypeHandle][$recordName])) {
                $definition = array_replace_recursive($definition, $overrideData[$dataTypeHandle][$recordName]);
            }

            $definitions[$dataTypeHandle][$recordName] = $definition;
        }

        return $definitions;
    }