Unfortunately, there’s very little about ZF2 that makes sense to me. Nevertheless, I tried.


In module.config.php, I’ve got this:

$config = array(

    'service_manager' => array(

        'factories' => array(

            'VuFind\ILSHoldLogic' => function ($sm) {

                return new \Yln\ILS\Logic\Holds(

                    $sm->get('VuFind\AuthManager'), $sm->get('VuFind\ILSConnection'),

                    $sm->get('VuFind\HMAC'), $sm->get('VuFind\Config')->get('config'), $sm->get('VuFind\RecordLoader')



In my extended Holds class, I added:

protected $loader;


And then in driverHoldings(), I added:

$recordDriver = $loader->load($result[0]['id']);


The Apache error I get is “Call to a member function load() on a non-object”.


Am I even getting kinda close?





From: Demian Katz [mailto:demian.katz@villanova.edu]
Sent: Wednesday, March 06, 2013 5:37 AM
To: Chanel Wheeler; vufind-tech (vufind-tech@lists.sourceforge.net)
Subject: RE: calling SolrMarc function from Holds


The easiest (though perhaps not most efficient) approach would be to adjust the factory configuration in module.config.php to inject the VuFind\RecordLoader service from the top-level service manager into either the Holds or Symphony object (you'd obviously have to adjust the constructor and/or add a setter to provide a means of passing in the record loader).  Once the record loader is passed in, you can use it to load the record for the ID being processed ($recordDriver = $recordLoader->load($id)), and then you can call getBibliographicLevel on that object.

Let me know if that makes any sense -- I can provide some more specifics if necessary (though probably not until tomorrow -- I'm out of the office today).

- Demian

From: Chanel Wheeler [Chanel.Wheeler@yavapai.us]
Sent: Tuesday, March 05, 2013 6:37 PM
To: vufind-tech (vufind-tech@lists.sourceforge.net)
Subject: [VuFind-Tech] calling SolrMarc function from Holds

Is there any way to call getBibliographicLevel() in SolrMarc from the Holds class or the Symphony class? I’ve tried lots of crazy ways and have had no luck.





Chanel Wheeler

Library Network Programmer/Analyst

Yavapai Library Network

1120 Commerce Dr.

Prescott, AZ  86305


Phone: (928) 442-5741


Open a help desk ticket