12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
-
- /*
- * This file is part of the Sonata package.
- *
- * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
- namespace Exporter\Writer;
-
- use Exporter\Exception\InvalidDataFormatException;
-
- class InMemoryWriter implements WriterInterface
- {
- protected $elements;
-
- /**
- * {@inheritdoc}
- */
- public function open()
- {
- $this->elements = array();
- }
-
- /**
- * {@inheritdoc}
- */
- public function close()
- {
- return $this->elements;
- }
-
- /**
- * {@inheritdoc}
- */
- public function write(array $data)
- {
- $this->elements[] = $data;
- }
-
- /**
- * @return array
- */
- public function getElements()
- {
- return $this->elements;
- }
- }
|