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

namespace Ayaline\Bundle\EzSitBundle\DwSerialiser\DataType;

use Ayaline\Bundle\EzSitBundle\DwSerialiser\Entities\TraitementCategories\Categories;

class TraitementCategories extends TraitementParent {
    /**
     * Returns the Assetic resource.
     *
     * @return Categories 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\TraitementCategories\Categories',
                    'xml'
                );
                $this->logger->info("Objet 'Ayaline\\Bundle\\EzSitBundle\\DwSerialiser\\Entities\\TraitementCategories\\Categories' bien désérialisé.");
                return $produitObject;
            } catch (\Exception $e) {
                $this->logger->error("Un objet de type 'Ayaline\\Bundle\\EzSitBundle\\DwSerialiser\\Entities\\TraitementCategories\\Categories' n'est pas chargé: " . $e->getMessage());
            }
        }
        return false;
    }

} 