<?php
/**
 * Created by PhpStorm.
 * User: sdaoudi
 * Date: 07/11/14
 * Time: 14:55
 */

namespace Ayaline\Bundle\EzSitBundle\DwSerialiser\DataType;


use Ayaline\Bundle\EzSitBundle\DwSerialiser\Entities\TraitementRecherche\Resultats;

class TraitementRecherche extends TraitementParent {
    /**
     * Returns the Assetic resource.
     *
     * @return Resultats The wrapped Assetic resource
     */
    public function deserialize()
    {
        if (isset($this->xmlFileContent) && !empty($this->xmlFileContent)) {

            try {

                $produitObject = $this->serializer->deserialize(
                    $this->xmlFileContent,
                    'Ayaline\Bundle\EzSitBundle\DwSerialiser\Entities\TraitementRecherche\Resultats',
                    'xml'
                );
                $this->logger->info("Objet 'Ayaline\\Bundle\\EzSitBundle\\DwSerialiser\\Entities\\TraitementRecherche\\Resultats' bien désérialisé.");
                return $produitObject;
            } catch (\Exception $e) {
                $this->logger->error("Un objet de type 'Ayaline\\Bundle\\EzSitBundle\\DwSerialiser\\Entities\\TraitementRecherche\\Resultats' n'est pas chargé: " . $e->getMessage());
            }
        }
        return false;
    }

} 