Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SourceFactory.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  protected $objectManager;
14 
19  {
20  $this->objectManager = $objectManager;
21  }
22 
30  public function create($className)
31  {
32  $source = $this->objectManager->create($className);
33  if (!$source instanceof SourceProviderInterface) {
34  throw new \InvalidArgumentException(
35  $className . ' doesn\'t implement \Magento\Framework\App\ResourceConnection\SourceProviderInterface'
36  );
37  }
38 
39  return $source;
40  }
41 }
$source
Definition: source.php:23
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31