-
-
Save dragoonis/67133a2fe14c4e9010fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace TWGModule\Factory; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use Zend\ServiceManager\FactoryInterface; | |
use TWG\PropertyService; | |
class PropertyServiceFactory implements FactoryInterface | |
{ | |
public function createService(ServiceLocatorInterface $sm) | |
{ | |
$config = $sm->get('Config'); | |
if(!isset($config['property_upload_path'])) { | |
throw new \Exception('Missing property_upload_path'); | |
} | |
if(!isset($config['upload_path'])) { | |
throw new \Exception('Missing upload_path'); | |
} | |
$uploadPath = $config['upload_path']; | |
$path = $config['property_upload_path']; | |
$svc = new PropertyService( | |
$sm->get('Doctrine\ORM\EntityManager'), | |
$sm->get('property.branch.service') | |
); | |
$svc->getImageService()->setUploadPath($uploadPath, $path); | |
return $svc; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment