[TASK][WIP] Move non class code back to source files
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Property / TypeConverter / FolderConverter.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24 /**
25 * Converter which transforms simple types to Tx_Extbase_Domain_Model_Folder.
26 *
27 * @api experimental! This class is experimental and subject to change!
28 */
29 class Tx_Extbase_Property_TypeConverter_FolderConverter extends Tx_Extbase_Property_TypeConverter_AbstractFileFolderConverter implements t3lib_Singleton {
30
31 /**
32 * @var array<string>
33 */
34 protected $sourceTypes = array('string');
35
36 /**
37 * @var string
38 */
39 protected $targetType = 'Tx_Extbase_Domain_Model_Folder';
40
41 /**
42 * @var string
43 */
44 protected $expectedObjectType = 't3lib_file_Folder';
45
46 /**
47 * @param string $source
48 * @return t3lib_file_Folder
49 */
50 protected function getObject($source) {
51 return $this->fileFactory->getFolderObjectFromCombinedIdentifier($source);
52 }
53
54 }
55
56 ?>