Пример #1
0
 /**
  * @param null|PlatformInterface|AdapterInterface $adapterOrPlatform
  *
  * @return PlatformInterface
  *
  * @throws Exception\InvalidArgumentException
  */
 protected function resolvePlatform($adapterOrPlatform)
 {
     if (!$adapterOrPlatform) {
         return $this->getDefaultPlatform();
     }
     if ($adapterOrPlatform instanceof AdapterInterface) {
         return $adapterOrPlatform->getPlatform();
     }
     if ($adapterOrPlatform instanceof PlatformInterface) {
         return $adapterOrPlatform;
     }
     throw new Exception\InvalidArgumentException(sprintf('$adapterOrPlatform should be null, %s, or %s', 'Zend\\Db\\Adapter\\AdapterInterface', 'Zend\\Db\\Adapter\\Platform\\PlatformInterface'));
 }