TYPO3 CMS  TYPO3_6-2
AbstractFileFolderConverter.php
Go to the documentation of this file.
1 <?php
3 
22 
26  protected $priority = 1;
27 
32 
37  protected $fileFactory;
38 
51  public function convertFrom($source, $targetType, array $convertedChildProperties = array(), \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration = NULL) {
52  $object = $this->getOriginalResource($source);
53  if (empty($this->expectedObjectType) || !$object instanceof $this->expectedObjectType) {
54  throw new \TYPO3\CMS\Extbase\Property\Exception('Expected object of type "' . $this->expectedObjectType . '" but got ' . get_class($object), 1342895975);
55  }
57  $subject = $this->objectManager->get($targetType);
58  $subject->setOriginalResource($object);
59  return $subject;
60  }
61 
66  abstract protected function getOriginalResource($source);
67 }
convertFrom($source, $targetType, array $convertedChildProperties=array(), \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration=NULL)