public function getValidPortableElementFromZipSource($type, $zipFile)
    {
        /** @var PortableElementPackageParser $parser */
        $parser = $this->getPortableModelRegistry()->getModel($type)->getPackageParser();
        $source = $parser->extract($zipFile);
        $object = $parser->getModel()->createDataObject($parser->getManifestContent($zipFile));
        $this->validate($object, $source);

        return $object;
    }
public function getValidPortableElementFromZipSource($type, $zipFile)
    {
        /** @var PortableElementPackageParser $parser */
        $parser = $this->getPortableModelRegistry()->getModel($type)->getPackageParser();
        $source = $parser->extract($zipFile);
        $object = $parser->getModel()->createDataObject($parser->getManifestContent($zipFile));
        $this->validate($object, $source);

        return $object;
    }
public function getValidPortableElementFromZipSource ( $ type , $ zipFile ) { /** @var PortableElementPackageParser $parser */ $ parser = $ this -> getPortableModelRegistry ( ) -> getModel ( $ type ) -> getPackageParser ( ) ; $ source = $ parser -> extract ( $ zipFile ) ; $ object = $ parser -> getModel ( ) -> createDataObject ( $ parser -> getManifestContent ( $ zipFile ) ) ; $ this -> validate ( $ object , $ source ) ; return $ object ; }
Extract a valid model from a zip

@param $type
@param $zipFile
@return mixed
@throws PortableElementInconsistencyModelException
Extract a valid model from a zip