Пример #1
0
 /**
  * Constructor
  *
  * @param ConfigInterface $configuration Configuration settings (optional)
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     // These objects are not meant to be shared -- every time we retrieve one,
     // we are building a brand new object.
     $this->setShareByDefault(false);
     parent::__construct($configuration);
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param ConfigInterface $configuration Configuration settings (optional)
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     // These plugins are not meant to be shared -- the same module may be used
     // multiple times with different configurations, so we need to build a new
     // copy each time the plugin is retrieved.
     $this->setShareByDefault(false);
     parent::__construct($configuration);
 }
Пример #3
0
 /**
  * Constructor
  *
  * Make sure table gateways are properly initialized.
  *
  * @param ConfigInterface $configuration Configuration settings (optional)
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     parent::__construct($configuration);
     $initializer = function ($instance, $manager) {
         $instance->setAdapter($manager->getServiceLocator()->get('VuFind\\DbAdapter'));
         $instance->initialize();
     };
     $this->addInitializer($initializer, false);
 }
Пример #4
0
 /**
  * Constructor
  *
  * @param ConfigInterface $configuration Configuration settings (optional)
  */
 public function __construct(ConfigInterface $configuration = null)
 {
     // Record drivers are not meant to be shared -- every time we retrieve one,
     // we are building a brand new object.
     $this->setShareByDefault(false);
     parent::__construct($configuration);
     // Add an initializer for setting up hierarchies
     $initializer = function ($instance, $manager) {
         $hasHierarchyType = is_callable([$instance, 'getHierarchyType']);
         if ($hasHierarchyType && is_callable([$instance, 'setHierarchyDriverManager'])) {
             $sm = $manager->getServiceLocator();
             if ($sm && $sm->has('VuFind\\HierarchyDriverPluginManager')) {
                 $instance->setHierarchyDriverManager($sm->get('VuFind\\HierarchyDriverPluginManager'));
             }
         }
     };
     $this->addInitializer($initializer, false);
 }