--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+abstract class Tx_Extbase_Domain_Model_AbstractFileCollection extends Tx_Extbase_DomainObject_AbstractEntity {
+ /**
+ * @var t3lib_file_Collection_AbstractFileCollection
+ */
+ protected $object;
+
+ /**
+ * @param t3lib_file_Collection_AbstractFileCollection $object
+ */
+ public function setObject(t3lib_file_Collection_AbstractFileCollection $object) {
+ $this->object = $object;
+ }
+
+ /**
+ * @return t3lib_file_Collection_AbstractFileCollection
+ */
+ public function getObject() {
+ return $this->object;
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+abstract class Tx_Extbase_Domain_Model_AbstractFileFolder extends Tx_Extbase_DomainObject_AbstractEntity {
+ /**
+ * @var t3lib_file_ResourceInterface|t3lib_file_Folder|t3lib_file_AbstractFile
+ */
+ protected $object;
+
+ /**
+ * @param t3lib_file_ResourceInterface $object
+ */
+ public function setObject(t3lib_file_ResourceInterface $object) {
+ $this->object = $object;
+ }
+
+ /**
+ * @return t3lib_file_ResourceInterface|t3lib_file_Folder|t3lib_file_AbstractFile
+ */
+ public function getObject() {
+ return $this->object;
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Domain_Model_File extends Tx_Extbase_Domain_Model_AbstractFileFolder {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file reference object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Domain_Model_FileReference extends Tx_Extbase_Domain_Model_AbstractFileFolder {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A folder object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Domain_Model_Folder extends Tx_Extbase_Domain_Model_AbstractFileFolder {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file collection object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Domain_Model_FolderBasedFileCollection extends Tx_Extbase_Domain_Model_AbstractFileCollection {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file collection object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Domain_Model_StaticFileCollection extends Tx_Extbase_Domain_Model_AbstractFileCollection {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_File.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+abstract class Tx_Extbase_Property_TypeConverter_AbstractFileCollectionConverter extends Tx_Extbase_Property_TypeConverter_AbstractTypeConverter {
+ /**
+ * @var integer
+ */
+ protected $priority = 1;
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType;
+
+ /**
+ * @var t3lib_file_Factory
+ */
+ protected $fileFactory;
+
+ /**
+ * @param t3lib_file_Factory $fileFactory
+ */
+ public function injectFileFactory(t3lib_file_Factory $fileFactory) {
+ $this->fileFactory = $fileFactory;
+ }
+
+ /**
+ * Actually convert from $source to $targetType, taking into account the fully
+ * built $convertedChildProperties and $configuration.
+ *
+ * @param integer $source
+ * @param string $targetType
+ * @param array $convertedChildProperties
+ * @param Tx_Extbase_Property_PropertyMappingConfigurationInterface $configuration
+ * @return Tx_Extbase_Domain_Model_AbstractFileCollection
+ * @api
+ */
+ public function convertFrom($source, $targetType, array $convertedChildProperties = array(), Tx_Extbase_Property_PropertyMappingConfigurationInterface $configuration = NULL) {
+ $object = $this->getObject($source);
+
+ if (empty($this->expectedObjectType) || !$object instanceof $this->expectedObjectType) {
+ throw new Tx_Extbase_Property_Exception(
+ 'Expected object of type "' . $this->expectedObjectType . '" but got ' . get_class($object),
+ 1342895975
+ );
+ }
+
+ /** @var $subject Tx_Extbase_Domain_Model_AbstractFileCollection */
+ $subject = $this->objectManager->create($targetType);
+ $subject->setObject($object);
+
+ return $subject;
+ }
+
+ /**
+ * @param integer $source
+ * @return t3lib_file_Collection_AbstractFileCollection
+ */
+ abstract protected function getObject($source);
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_File.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+abstract class Tx_Extbase_Property_TypeConverter_AbstractFileFolderConverter extends Tx_Extbase_Property_TypeConverter_AbstractTypeConverter {
+ /**
+ * @var integer
+ */
+ protected $priority = 1;
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType;
+
+ /**
+ * @var t3lib_file_Factory
+ */
+ protected $fileFactory;
+
+ /**
+ * @param t3lib_file_Factory $fileFactory
+ */
+ public function injectFileFactory(t3lib_file_Factory $fileFactory) {
+ $this->fileFactory = $fileFactory;
+ }
+
+ /**
+ * Actually convert from $source to $targetType, taking into account the fully
+ * built $convertedChildProperties and $configuration.
+ *
+ * @param string|integer $source
+ * @param string $targetType
+ * @param array $convertedChildProperties
+ * @param Tx_Extbase_Property_PropertyMappingConfigurationInterface $configuration
+ * @return Tx_Extbase_Domain_Model_AbstractFileFolder
+ * @api
+ */
+ public function convertFrom($source, $targetType, array $convertedChildProperties = array(), Tx_Extbase_Property_PropertyMappingConfigurationInterface $configuration = NULL) {
+ $object = $this->getObject($source);
+
+ if (empty($this->expectedObjectType) || !$object instanceof $this->expectedObjectType) {
+ throw new Tx_Extbase_Property_Exception(
+ 'Expected object of type "' . $this->expectedObjectType . '" but got ' . get_class($object),
+ 1342895975
+ );
+ }
+
+ /** @var $subject Tx_Extbase_Domain_Model_AbstractFileFolder */
+ $subject = $this->objectManager->create($targetType);
+ $subject->setObject($object);
+
+ return $subject;
+ }
+
+ /**
+ * @param string|integer $source
+ * @return t3lib_file_ResourceInterface
+ */
+ abstract protected function getObject($source);
+}
+?>
\ No newline at end of file
*/
protected $priority;
+ /**
+ * @var Tx_Extbase_Object_ObjectManager
+ */
+ protected $objectManager;
+
+ /**
+ * Injects the object manager.
+ *
+ * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
+ */
+ public function injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface $objectManager) {
+ $this->objectManager = $objectManager;
+ }
+
/**
* Returns the list of source types the TypeConverter can handle.
* Must be PHP simple types, classes or object is not allowed.
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_File.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Property_TypeConverter_FileConverter extends Tx_Extbase_Property_TypeConverter_AbstractFileFolderConverter implements t3lib_Singleton {
+ /**
+ * @var array<string>
+ */
+ protected $sourceTypes = array('integer', 'string');
+
+ /**
+ * @var string
+ */
+ protected $targetType = 'Tx_Extbase_Domain_Model_File';
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType = 't3lib_file_File';
+
+ /**
+ * @param string|integer $source
+ * @return t3lib_file_FileInterface|t3lib_file_Folder
+ */
+ protected function getObject($source) {
+ return $this->fileFactory->retrieveFileOrFolderObject($source);
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_FileReference.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Property_TypeConverter_FileReferenceConverter extends Tx_Extbase_Property_TypeConverter_AbstractFileFolderConverter implements t3lib_Singleton {
+ /**
+ * @var array<string>
+ */
+ protected $sourceTypes = array('integer');
+
+ /**
+ * @var string
+ */
+ protected $targetType = 'Tx_Extbase_Domain_Model_FileReference';
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType = 't3lib_file_FileReference';
+
+ /**
+ * @param integer $source
+ * @return t3lib_file_FileReference
+ */
+ protected function getObject($source) {
+ return $this->fileFactory->getFileReferenceObject($source);
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_FileCollection.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Property_TypeConverter_FolderBasedFileCollectionConverter extends Tx_Extbase_Property_TypeConverter_AbstractFileCollectionConverter implements t3lib_Singleton {
+ /**
+ * @var array<string>
+ */
+ protected $sourceTypes = array('integer');
+
+ /**
+ * @var string
+ */
+ protected $targetType = 'Tx_Extbase_Domain_Model_FolderBasedFileCollection';
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType = 't3lib_file_Collection_FolderBasedFileCollection';
+
+ /**
+ * @param integer $source
+ * @return t3lib_file_Collection_FolderBasedFileCollection
+ */
+ protected function getObject($source) {
+ return $this->fileFactory->getCollectionObject($source);
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_Folder.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Property_TypeConverter_FolderConverter extends Tx_Extbase_Property_TypeConverter_AbstractFileFolderConverter implements t3lib_Singleton {
+ /**
+ * @var array<string>
+ */
+ protected $sourceTypes = array('string');
+
+ /**
+ * @var string
+ */
+ protected $targetType = 'Tx_Extbase_Domain_Model_Folder';
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType = 't3lib_file_Folder';
+
+ /**
+ * @param string $source
+ * @return t3lib_file_Folder
+ */
+ protected function getObject($source) {
+ return $this->fileFactory->getFolderObjectFromCombinedIdentifier($source);
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Converter which transforms simple types to Tx_Extbase_Domain_Model_FileCollection.
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+class Tx_Extbase_Property_TypeConverter_StaticFileCollectionConverter extends Tx_Extbase_Property_TypeConverter_AbstractFileCollectionConverter implements t3lib_Singleton {
+ /**
+ * @var array<string>
+ */
+ protected $sourceTypes = array('integer');
+
+ /**
+ * @var string
+ */
+ protected $targetType = 'Tx_Extbase_Domain_Model_StaticFileCollection';
+
+ /**
+ * @var string
+ */
+ protected $expectedObjectType = 't3lib_file_Collection_StaticFileCollection';
+
+ /**
+ * @param integer $source
+ * @return t3lib_file_Collection_StaticFileCollection
+ */
+ protected function getObject($source) {
+ return $this->fileFactory->getCollectionObject($source);
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * (c) 2009-2012 Jochen Rau <jochen.rau@typoplanet.de>
+ * All rights reserved
+ *
+ * This class is a backport of the corresponding class of FLOW3.
+ * All credits go to the v5 team.
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Base database testcase for the Extbase extension.
+ *
+ * This base test case creates a test database and can populate
+ * rows defined in fixtures to it.
+ *
+ * This class is used in the FAL<->extbase connection tests like
+ * Tx_Extbase_Tests_Functional_Domain_Model_FileContextTest. It is
+ * currently marked as experimental!
+ *
+ * @api experimental! This class is experimental and subject to change!
+ */
+abstract class Tx_Extbase_Tests_Functional_BaseTestCase extends Tx_Phpunit_Database_TestCase {
+ /**
+ * @var Tx_Extbase_Object_ObjectManagerInterface The object manager
+ */
+ protected $objectManager;
+
+ /**
+ * Injects an untainted clone of the object manager and all its referencing
+ * objects for every test.
+ *
+ * @return void
+ */
+ public function runBare() {
+ $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+ $this->objectManager = clone $objectManager;
+ parent::runBare();
+ }
+
+ protected function setUp() {
+ $this->createDatabase();
+ $this->useTestDatabase();
+
+ $this->importStdDb();
+ $this->importExtensions(array('cms', 'extbase'));
+ }
+
+ protected function tearDown() {
+ $this->dropDatabase();
+ }
+}
+?>
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+require_once t3lib_extMgm::extPath('extbase') . 'Tests/Functional/Domain/Model/Fixture/FileContext.php';
+
+/**
+ * Test case to check functionality type converters on FAL domain objects.
+ */
+class Tx_Extbase_Tests_Functional_Domain_Model_FileContextTest extends Tx_Extbase_Tests_Functional_BaseTestCase {
+ /**
+ * @var Tx_Extbase_Property_PropertyMapper
+ */
+ protected $propertyMapper;
+
+ /**
+ * @var Tx_Extbase_MVC_Controller_MvcPropertyMappingConfiguration
+ */
+ protected $propertyMapperConfiguration;
+
+ /**
+ * Sets up this test suite.
+ */
+ protected function setUp() {
+ parent::setUp();
+
+ $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file_storage.xml');
+ $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file.xml');
+ $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file_reference.xml');
+ $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file_collection.xml');
+
+ /** @var $configurationBuilder Tx_Extbase_Property_PropertyMappingConfigurationBuilder */
+ $configurationBuilder = $this->objectManager->get('Tx_Extbase_Property_PropertyMappingConfigurationBuilder');
+
+ $this->propertyMapperConfiguration = $configurationBuilder->build(
+ 'Tx_Extbase_MVC_Controller_MvcPropertyMappingConfiguration'
+ );
+
+ $this->propertyMapper = $this->objectManager->get('Tx_Extbase_Property_PropertyMapper');
+ }
+
+ /**
+ * Cleans up this test suite.
+ */
+ protected function tearDown() {
+ parent::tearDown();
+
+ unset($this->propertyMapperConfiguration);
+ unset($this->propertyMapper);
+ }
+
+ /**
+ * @test
+ */
+ public function fileObjectIsAvailable() {
+ $data = array(
+ 'file' => 1,
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_File', $fixture->getFile());
+ $this->assertInstanceOf('t3lib_file_File', $fixture->getFile()->getObject());
+ $this->assertEquals(1, $fixture->getFile()->getObject()->getUid());
+ }
+
+ /**
+ * @test
+ */
+ public function areFileObjectsAvailableFromFixture() {
+ $data = array(
+ 'files' => array(
+ 1,
+ 2,
+ ),
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Persistence_ObjectStorage', $fixture->getFiles());
+ $this->assertEquals(2, $fixture->getFiles()->count());
+
+ $fixture->getFiles()->rewind();
+ $this->assertEquals(1, $fixture->getFiles()->current()->getObject()->getUid());
+ $fixture->getFiles()->next();
+ $this->assertEquals(2, $fixture->getFiles()->current()->getObject()->getUid());
+ }
+
+ /**
+ * @test
+ */
+ public function isFileReferenceObjectAvailableFromFixture() {
+ $data = array(
+ 'fileReference' => 1,
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_FileReference', $fixture->getFileReference());
+ $this->assertInstanceOf('t3lib_file_FileReference', $fixture->getFileReference()->getObject());
+ $this->assertInstanceOf('t3lib_file_File', $fixture->getFileReference()->getObject()->getOriginalFile());
+ $this->assertEquals(1, $fixture->getFileReference()->getObject()->getOriginalFile()->getUid());
+ }
+
+ /**
+ * @test
+ */
+ public function areFileReferenceObjectsAvailableFromFixture() {
+ $data = array(
+ 'fileReferences' => array(
+ 1,
+ 2,
+ ),
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Persistence_ObjectStorage', $fixture->getFileReferences());
+ $this->assertEquals(2, $fixture->getFileReferences()->count());
+
+ $fixture->getFileReferences()->rewind();
+ $this->assertInstanceOf('t3lib_file_FileReference', $fixture->getFileReferences()->current()->getObject());
+ $this->assertInstanceOf('t3lib_file_File', $fixture->getFileReferences()->current()->getObject()->getOriginalFile());
+ $this->assertEquals(1, $fixture->getFileReferences()->current()->getObject()->getOriginalFile()->getUid());
+ $fixture->getFileReferences()->next();
+ $this->assertInstanceOf('t3lib_file_FileReference', $fixture->getFileReferences()->current()->getObject());
+ $this->assertInstanceOf('t3lib_file_File', $fixture->getFileReferences()->current()->getObject()->getOriginalFile());
+ $this->assertEquals(2, $fixture->getFileReferences()->current()->getObject()->getOriginalFile()->getUid());
+ }
+
+ /**
+ * @test
+ * @todo Find a way to mock the storage through all instances of Extbase
+ */
+ public function isFolderObjectAvailableFromFixture() {
+ if (!defined('TYPO3_MODE') || TYPO3_MODE !== 'BE') {
+ $this->markTestSkipped('This test currently relies on an existing fileadmin/ storage in the filesystem.');
+ }
+
+ $data = array(
+ 'folder' => '9999:/',
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_Folder', $fixture->getFolder());
+ $this->assertInstanceOf('t3lib_file_Folder', $fixture->getFolder()->getObject());
+ $this->assertEquals('/', $fixture->getFolder()->getObject()->getIdentifier());
+ }
+
+ /**
+ * @test
+ * @todo Find a way to mock the storage through all instances of Extbase
+ */
+ public function areFolderObjectsAvailableFromFixture() {
+ if (!defined('TYPO3_MODE') || TYPO3_MODE !== 'BE') {
+ $this->markTestSkipped('This test currently relies on an existing fileadmin/ storage in the filesystem.');
+ }
+
+ $data = array(
+ 'folders' => array(
+ '9999:/',
+ '9999:/',
+ ),
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Persistence_ObjectStorage', $fixture->getFolders());
+ $this->assertEquals(2, $fixture->getFolders()->count());
+
+ $fixture->getFolders()->rewind();
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_Folder', $fixture->getFolders()->current());
+ $this->assertInstanceOf('t3lib_file_Folder', $fixture->getFolders()->current()->getObject());
+ $this->assertEquals('/', $fixture->getFolders()->current()->getObject()->getIdentifier());
+ $fixture->getFolders()->next();
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_Folder', $fixture->getFolders()->current());
+ $this->assertInstanceOf('t3lib_file_Folder', $fixture->getFolders()->current()->getObject());
+ $this->assertEquals('/', $fixture->getFolders()->current()->getObject()->getIdentifier());
+ }
+
+ /**
+ * @test
+ */
+ public function isStaticFileCollectionObjectAvailableFromFixture() {
+ $data = array(
+ 'staticFileCollection' => 2,
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_StaticFileCollection', $fixture->getStaticFileCollection());
+ $this->assertEquals(2, $fixture->getStaticFileCollection()->getObject()->getUid());
+ }
+
+ /**
+ * @test
+ */
+ public function areStaticFileCollectionObjectsAvailableFromFixture() {
+ $data = array(
+ 'staticFileCollections' => array(
+ 2,
+ ),
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Persistence_ObjectStorage', $fixture->getStaticFileCollections());
+ $this->assertEquals(1, $fixture->getStaticFileCollections()->count());
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_StaticFileCollection', $fixture->getStaticFileCollections()->current());
+ $this->assertEquals(2, $fixture->getStaticFileCollections()->current()->getObject()->getUid());
+ }
+
+ /**
+ * @test
+ */
+ public function isFolderBasedFileCollectionObjectAvailableFromFixture() {
+ $data = array(
+ 'folderBasedFileCollection' => 1,
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_FolderBasedFileCollection', $fixture->getFolderBasedFileCollection());
+ $this->assertEquals(1, $fixture->getFolderBasedFileCollection()->getObject()->getUid());
+ }
+
+ /**
+ * @test
+ */
+ public function areFolderBasedFileCollectionObjectAvailableFromFixture() {
+ $data = array(
+ 'folderBasedFileCollections' => array(
+ 1,
+ ),
+ );
+
+ /** @var $fixture Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext */
+ $fixture = $this->propertyMapper->convert(
+ $data,
+ 'Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext',
+ $this->propertyMapperConfiguration
+ );
+
+ $this->assertInstanceOf('Tx_Extbase_Persistence_ObjectStorage', $fixture->getFolderBasedFileCollections());
+ $this->assertEquals(1, $fixture->getFolderBasedFileCollections()->count());
+
+ $this->assertInstanceOf('Tx_Extbase_Domain_Model_FolderBasedFileCollection', $fixture->getFolderBasedFileCollections()->current());
+ $this->assertEquals(1, $fixture->getFolderBasedFileCollections()->current()->getObject()->getUid());
+ }
+}
+?>
--- /dev/null
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * A file context object (File Abstraction Layer)
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ * @scope prototype
+ * @entity
+ * @api
+ */
+class Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext extends Tx_Extbase_DomainObject_AbstractEntity {
+ /**
+ * @var Tx_Extbase_Domain_Model_File
+ */
+ protected $file;
+
+ /**
+ * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_File>
+ */
+ protected $files;
+
+ /**
+ * @var Tx_Extbase_Domain_Model_FileReference
+ */
+ protected $fileReference;
+
+ /**
+ * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FileReference>
+ */
+ protected $fileReferences;
+
+ /**
+ * @var Tx_Extbase_Domain_Model_StaticFileCollection
+ */
+ protected $staticFileCollection;
+
+ /**
+ * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_StaticFileCollection>
+ */
+ protected $staticFileCollections;
+
+ /**
+ * @var Tx_Extbase_Domain_Model_FolderBasedFileCollection
+ */
+ protected $folderBasedFileCollection;
+
+ /**
+ * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FolderBasedFileCollection>
+ */
+ protected $folderBasedFileCollections;
+
+ /**
+ * @var Tx_Extbase_Domain_Model_Folder
+ */
+ protected $folder;
+
+ /**
+ * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_Folder>
+ */
+ protected $folders;
+
+ public function __construct() {
+ $this->files = new Tx_Extbase_Persistence_ObjectStorage();
+ $this->fileReferences = new Tx_Extbase_Persistence_ObjectStorage();
+ $this->staticFileCollections = new Tx_Extbase_Persistence_ObjectStorage();
+ $this->folderBasedFileCollections = new Tx_Extbase_Persistence_ObjectStorage();
+ $this->folders = new Tx_Extbase_Persistence_ObjectStorage();
+ }
+
+ /**
+ * FILE
+ */
+
+ /**
+ * @return Tx_Extbase_Domain_Model_File
+ */
+ public function getFile() {
+ return $this->file;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_File $file
+ */
+ public function setFile(Tx_Extbase_Domain_Model_File $file) {
+ $this->file = $file;
+ }
+
+ /**
+ * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_File>
+ */
+ public function getFiles() {
+ return $this->files;
+ }
+
+ /**
+ * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_File> $files
+ */
+ public function setFiles(Tx_Extbase_Persistence_ObjectStorage $files) {
+ $this->files = $files;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_File $file
+ */
+ public function addFile(Tx_Extbase_Domain_Model_File $file) {
+ $this->files->attach($file);
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_File $file
+ */
+ public function removeFile(Tx_Extbase_Domain_Model_File $file) {
+ $this->files->detach($file);
+ }
+
+ /**
+ * COLLECTION
+ */
+
+ /**
+ * @return Tx_Extbase_Domain_Model_StaticFileCollection
+ */
+ public function getStaticFileCollection() {
+ return $this->staticFileCollection;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection
+ */
+ public function setStaticFileCollection(Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection) {
+ $this->staticFileCollection = $staticFileCollection;
+ }
+
+ /**
+ * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_StaticFileCollection>
+ */
+ public function getStaticFileCollections() {
+ return $this->staticFileCollections;
+ }
+
+ /**
+ * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_StaticFileCollection> $staticFileCollections
+ */
+ public function setStaticFileCollections(Tx_Extbase_Persistence_ObjectStorage $staticFileCollections) {
+ $this->staticFileCollections = $staticFileCollections;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection
+ */
+ public function addStaticFileCollection(Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection) {
+ $this->staticFileCollections->attach($staticFileCollection);
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection
+ */
+ public function removeStaticFileCollection(Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection) {
+ $this->staticFileCollections->detach($staticFileCollection);
+ }
+
+ /**
+ * @return Tx_Extbase_Domain_Model_FolderBasedFileCollection
+ */
+ public function getFolderBasedFileCollection() {
+ return $this->folderBasedFileCollection;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection
+ */
+ public function setFolderBasedFileCollection(Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection) {
+ $this->folderBasedFileCollection = $folderBasedFileCollection;
+ }
+
+ /**
+ * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FolderBasedFileCollection>
+ */
+ public function getFolderBasedFileCollections() {
+ return $this->folderBasedFileCollections;
+ }
+
+ /**
+ * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FolderBasedFileCollection> $folderBasedFileCollections
+ */
+ public function setFolderBasedFileCollections(Tx_Extbase_Persistence_ObjectStorage $folderBasedFileCollections) {
+ $this->folderBasedFileCollections = $folderBasedFileCollections;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection
+ */
+ public function addFolderBasedFileCollection(Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection) {
+ $this->folderBasedFileCollections->attach($folderBasedFileCollection);
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection
+ */
+ public function removeFolderBasedFileCollection(Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection) {
+ $this->folderBasedFileCollections->detach($folderBasedFileCollection);
+ }
+
+ /**
+ * REFERENCE
+ */
+
+ /**
+ * @return Tx_Extbase_Domain_Model_FileReference
+ */
+ public function getFileReference() {
+ return $this->fileReference;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_FileReference $fileReference
+ */
+ public function setFileReference(Tx_Extbase_Domain_Model_FileReference $fileReference) {
+ $this->fileReference = $fileReference;
+ }
+
+ /**
+ * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FileReference>
+ */
+ public function getFileReferences() {
+ return $this->fileReferences;
+ }
+
+ /**
+ * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FileReference> $fileReferences
+ */
+ public function setFileReferences(Tx_Extbase_Persistence_ObjectStorage $fileReferences) {
+ $this->fileReferences = $fileReferences;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_FileReference $fileReference
+ */
+ public function addFileReference(Tx_Extbase_Domain_Model_FileReference $fileReference) {
+ $this->fileReferences->attach($fileReference);
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_FileReference $fileReference
+ */
+ public function removeFileReference(Tx_Extbase_Domain_Model_FileReference $fileReference) {
+ $this->fileReferences->detach($fileReference);
+ }
+
+ /**
+ * FOLDER
+ */
+
+ /**
+ * @return Tx_Extbase_Domain_Model_Folder
+ */
+ public function getFolder() {
+ return $this->folder;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_Folder $folder
+ */
+ public function setFolder(Tx_Extbase_Domain_Model_Folder $folder) {
+ $this->folder = $folder;
+ }
+
+ /**
+ * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_Folder>
+ */
+ public function getFolders() {
+ return $this->folders;
+ }
+
+ /**
+ * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_Folder> $folders
+ */
+ public function setFolders(Tx_Extbase_Persistence_ObjectStorage $folders) {
+ $this->folders = $folders;
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_Folder $folder
+ */
+ public function addFolder(Tx_Extbase_Domain_Model_Folder $folder) {
+ $this->folders->attach($folder);
+ }
+
+ /**
+ * @param Tx_Extbase_Domain_Model_Folder $folder
+ */
+ public function removeFolder(Tx_Extbase_Domain_Model_Folder $folder) {
+ $this->folders->detach($folder);
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<dataset>
+ <sys_file>
+ <uid>1</uid>
+ <pid>0</pid>
+ <tstamp>1337721279</tstamp>
+ <crdate>1337721279</crdate>
+ <cruser_id>0</cruser_id>
+ <t3ver_oid>0</t3ver_oid>
+ <t3ver_id>0</t3ver_id>
+ <t3ver_wsid>0</t3ver_wsid>
+ <t3ver_label></t3ver_label>
+ <t3ver_state>0</t3ver_state>
+ <t3ver_stage>0</t3ver_stage>
+ <t3ver_count>0</t3ver_count>
+ <t3ver_tstamp>0</t3ver_tstamp>
+ <t3ver_move_id>0</t3ver_move_id>
+ <t3_origuid>0</t3_origuid>
+ <deleted>0</deleted>
+ <type>2</type>
+ <storage>9999</storage>
+ <identifier>/_test/testing.png</identifier>
+ <extension>jpeg</extension>
+ <mime_type>image/jpeg</mime_type>
+ <name>testing.png</name>
+ <sha1>b841902021bbe23bd71e4a5b5b97626da7734b90</sha1>
+ <size>39056</size>
+ <creation_date>1337721084</creation_date>
+ <modification_date>1337721081</modification_date>
+ <width>400</width>
+ <height>300</height>
+ <description></description>
+ <alternative></alternative>
+ </sys_file>
+ <sys_file>
+ <uid>2</uid>
+ <pid>0</pid>
+ <tstamp>1337721279</tstamp>
+ <crdate>1337721279</crdate>
+ <cruser_id>0</cruser_id>
+ <t3ver_oid>0</t3ver_oid>
+ <t3ver_id>0</t3ver_id>
+ <t3ver_wsid>0</t3ver_wsid>
+ <t3ver_label></t3ver_label>
+ <t3ver_state>0</t3ver_state>
+ <t3ver_stage>0</t3ver_stage>
+ <t3ver_count>0</t3ver_count>
+ <t3ver_tstamp>0</t3ver_tstamp>
+ <t3ver_move_id>0</t3ver_move_id>
+ <t3_origuid>0</t3_origuid>
+ <deleted>0</deleted>
+ <type>2</type>
+ <storage>9999</storage>
+ <identifier>/_test/testing1.png</identifier>
+ <extension>jpeg</extension>
+ <mime_type>image/jpeg</mime_type>
+ <name>testing.png</name>
+ <sha1>b841902021bbe23bd71e4a5b5b97626da7734b91</sha1>
+ <size>39056</size>
+ <creation_date>1337721084</creation_date>
+ <modification_date>1337721081</modification_date>
+ <width>400</width>
+ <height>300</height>
+ <description></description>
+ <alternative></alternative>
+ </sys_file>
+</dataset>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<dataset>
+ <sys_file_collection>
+ <uid>1</uid>
+ <pid>1</pid>
+ <tstamp>1345234690</tstamp>
+ <crdate>1345234662</crdate>
+ <cruser_id>1</cruser_id>
+ <t3ver_oid>0</t3ver_oid>
+ <t3ver_id>0</t3ver_id>
+ <t3ver_wsid>0</t3ver_wsid>
+ <t3ver_label></t3ver_label>
+ <t3ver_state>0</t3ver_state>
+ <t3ver_stage>0</t3ver_stage>
+ <t3ver_count>0</t3ver_count>
+ <t3ver_tstamp>0</t3ver_tstamp>
+ <t3ver_move_id>0</t3ver_move_id>
+ <t3_origuid>0</t3_origuid>
+ <sys_language_uid>0</sys_language_uid>
+ <l10n_parent>0</l10n_parent>
+ <l10n_diffsource></l10n_diffsource>
+ <deleted>0</deleted>
+ <hidden>0</hidden>
+ <starttime>0</starttime>
+ <endtime>0</endtime>
+ <title>Collection</title>
+ <description></description>
+ <type>folder</type>
+ <files>1</files>
+ <storage>9999</storage>
+ <folder>/default/</folder>
+ </sys_file_collection>
+ <sys_file_collection>
+ <uid>2</uid>
+ <pid>1</pid>
+ <tstamp>1345234710</tstamp>
+ <crdate>1345234710</crdate>
+ <cruser_id>1</cruser_id>
+ <t3ver_oid>0</t3ver_oid>
+ <t3ver_id>0</t3ver_id>
+ <t3ver_wsid>0</t3ver_wsid>
+ <t3ver_label></t3ver_label>
+ <t3ver_state>0</t3ver_state>
+ <t3ver_stage>0</t3ver_stage>
+ <t3ver_count>0</t3ver_count>
+ <t3ver_tstamp>0</t3ver_tstamp>
+ <t3ver_move_id>0</t3ver_move_id>
+ <t3_origuid>0</t3_origuid>
+ <sys_language_uid>0</sys_language_uid>
+ <l10n_parent>0</l10n_parent>
+ <l10n_diffsource></l10n_diffsource>
+ <deleted>0</deleted>
+ <hidden>0</hidden>
+ <starttime>0</starttime>
+ <endtime>0</endtime>
+ <title>Collection</title>
+ <description></description>
+ <type>static</type>
+ <files>2</files>
+ <storage>0</storage>
+ <folder></folder>
+ </sys_file_collection>
+</dataset>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<dataset>
+ <sys_file_reference>
+ <uid>1</uid>
+ <pid>0</pid>
+ <tstamp>1337721280</tstamp>
+ <crdate>1337721280</crdate>
+ <cruser_id>0</cruser_id>
+ <sorting>0</sorting>
+ <deleted>0</deleted>
+ <hidden>0</hidden>
+ <t3ver_oid>0</t3ver_oid>
+ <t3ver_id>0</t3ver_id>
+ <t3ver_wsid>0</t3ver_wsid>
+ <t3ver_label></t3ver_label>
+ <t3ver_state>0</t3ver_state>
+ <t3ver_stage>0</t3ver_stage>
+ <t3ver_count>0</t3ver_count>
+ <t3ver_tstamp>0</t3ver_tstamp>
+ <t3ver_move_id>0</t3ver_move_id>
+ <t3_origuid>0</t3_origuid>
+ <uid_local>1</uid_local>
+ <uid_foreign>246</uid_foreign>
+ <tablenames>tt_content</tablenames>
+ <fieldname>image</fieldname>
+ <sorting_foreign>0</sorting_foreign>
+ <table_local>sys_file</table_local>
+ <title>SomeTitle</title>
+ <description>SomeDescription</description>
+ <alternative>SomeAlternative</alternative>
+ <link>http://typo3.org/</link>
+ <downloadname>SomeDownloadname</downloadname>
+ </sys_file_reference>
+ <sys_file_reference>
+ <uid>2</uid>
+ <pid>0</pid>
+ <tstamp>1337721280</tstamp>
+ <crdate>1337721280</crdate>
+ <cruser_id>0</cruser_id>
+ <sorting>0</sorting>
+ <deleted>0</deleted>
+ <hidden>0</hidden>
+ <t3ver_oid>0</t3ver_oid>
+ <t3ver_id>0</t3ver_id>
+ <t3ver_wsid>0</t3ver_wsid>
+ <t3ver_label></t3ver_label>
+ <t3ver_state>0</t3ver_state>
+ <t3ver_stage>0</t3ver_stage>
+ <t3ver_count>0</t3ver_count>
+ <t3ver_tstamp>0</t3ver_tstamp>
+ <t3ver_move_id>0</t3ver_move_id>
+ <t3_origuid>0</t3_origuid>
+ <uid_local>2</uid_local>
+ <uid_foreign>246</uid_foreign>
+ <tablenames>tt_content</tablenames>
+ <fieldname>image</fieldname>
+ <sorting_foreign>0</sorting_foreign>
+ <table_local>sys_file</table_local>
+ <title>SomeTitle</title>
+ <description>SomeDescription</description>
+ <alternative>SomeAlternative</alternative>
+ <link>http://typo3.org/</link>
+ <downloadname>SomeDownloadname</downloadname>
+ </sys_file_reference>
+</dataset>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<dataset>
+ <sys_file_storage>
+ <uid>9999</uid>
+ <pid>0</pid>
+ <name>fileadmin/ (auto-created)</name>
+ <driver>Local</driver>
+ <configuration><![CDATA[<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+ <T3FlexForms>
+ <data>
+ <sheet index="sDEF">
+ <language index="lDEF">
+ <field index="basePath">
+ <value index="vDEF">fileadmin/</value>
+ </field>
+ <field index="pathType">
+ <value index="vDEF">relative</value>
+ </field>
+ </language>
+ </sheet>
+ </data>
+ </T3FlexForms>]]>
+ </configuration>
+ <is_browsable>1</is_browsable>
+ <is_public>1</is_public>
+ <is_writable>1</is_writable>
+ <is_online>1</is_online>
+ <processingfolder></processingfolder>
+ </sys_file_storage>
+</dataset>
\ No newline at end of file
return array(
'tx_extbase_tests_unit_basetestcase' => $extensionPath . 'Tests/Unit/BaseTestCase.php',
+ 'tx_extbase_tests_functional_basetestcase' => $extensionPath . 'Tests/Functional/BaseTestCase.php',
// for the autoloader to find the old persistence classes
'tx_extbase_persistence_backend' => $extensionClassesPath . 'Persistence/Generic/Backend.php',
Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_ObjectStorageConverter');
Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_PersistentObjectConverter');
Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_StringConverter');
+
+ // Experimental FAL<->extbase converters
+Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_FileConverter');
+Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_FileReferenceConverter');
+Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_FolderBasedFileCollectionConverter');
+Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_StaticFileCollectionConverter');
+Tx_Extbase_Utility_Extension::registerTypeConverter('Tx_Extbase_Property_TypeConverter_FolderConverter');
+
# $GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = 'EXT:extbase/Classes/Persistence/Hook/TCEMainValueObjectUpdater.php:tx_Extbase_Persistence_Hook_TCEMainValueObjectUpdater';
if (TYPO3_MODE === 'BE') {