propel-bundle/DataFixtures/Loader/YamlDataLoader.php
clombardot 3b4ce8e784 Enable php in yaml fixtures
Make easiest loading of serialized datas in object columns
2012-04-25 16:11:30 +02:00

39 lines
756 B
PHP

<?php
/**
* This file is part of the PropelBundle package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
namespace Propel\PropelBundle\DataFixtures\Loader;
use Symfony\Component\Yaml\Yaml;
/**
* YAML fixtures loader.
*
* @author William Durand <william.durand1@gmail.com>
*/
class YamlDataLoader extends AbstractDataLoader
{
/**
* {@inheritdoc}
*/
public function __construct($rootDir)
{
parent::__construct($rootDir);
Yaml::enablePhpParsing(true);
}
/**
* {@inheritdoc}
*/
protected function transformDataToArray($file)
{
return Yaml::parse($file);
}
}