public function getValidPortableElementFromDirectorySource($directory)
    {
        $parserMatched = null;
        $parsers = $this->getDirectoryParsers();
        /** @var PortableElementDirectoryParser $parser */
        foreach ($parsers as $parser) {
            if ($parser->hasValidPortableElement($directory)) {
                $parserMatched = $parser;
            }
        }

        if (is_null($parserMatched)) {
            throw new PortableElementParserException(
                'This zip source is not compatible with any portable element. Manifest and/or engine file are missing '
                . ' or related extensions are not installed.'
            );
        }

        $source = $parserMatched->extract($directory);
        $object = $parserMatched->getModel()->createDataObject($parserMatched->getManifestContent($directory));

        // Validate Portable Element  Model
        try {
            $this->validate($object, $source);
        } catch (PortableElementInvalidModelException $e) {
            \common_Logger::w($e->getMessage());
            return null;
        }

        return $object;
    }