Thanks for coming to the rescue. I would never have figured that out on my own. I’ve got title holds for monographs and copy holds for serials/journals working now.

 

Thank you!

chanel

 

From: Demian Katz [mailto:demian.katz@villanova.edu]
Sent: Monday, March 11, 2013 12:24 PM
To: Chanel Wheeler; vufind-tech (vufind-tech@lists.sourceforge.net)
Subject: RE: calling SolrMarc function from Holds

 

You are getting close – the part that’s missing is that your extended Holds class needs to have a __construct() function that accepts a record loader as its 5th parameter and stashes that in $this->loader, and driverHoldings() needs to use $this->loader instead of $loader.

 

To be even more explicit and save you a little time, here’s the constructor I think you’ll want:

 

    /**

     * Constructor

     *

     * @param \VuFind\Auth\Manager $account Auth manager object

     * @param ILSConnection        $ils     A catalog connection

     * @param \VuFind\Crypt\HMAC   $hmac    HMAC generator

     * @param \Zend\Config\Config  $config  VuFind configuration

     */

    public function __construct(\VuFind\Auth\Manager $account, ILSConnection $ils,

        \VuFind\Crypt\HMAC $hmac, \Zend\Config\Config $config,

        \VuFind\Record\Loader $loader

    ) {

        parent::__construct($account, $ils, $hmac, $config);

       $this->loader = $loader;

    }

 

Let me know if you still have problems!

 

- Demian

 

From: Chanel Wheeler [mailto:Chanel.Wheeler@yavapai.us]
Sent: Monday, March 11, 2013 1:01 PM
To: vufind-tech (vufind-tech@lists.sourceforge.net)
Subject: Re: [VuFind-Tech] calling SolrMarc function from Holds

 

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?

 

Thanks,

chanel

 

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.

 

Thanks,

chanel

 

Chanel Wheeler

Library Network Programmer/Analyst

Yavapai Library Network

1120 Commerce Dr.

Prescott, AZ  86305

 

Phone: (928) 442-5741

chanel.wheeler@yavapai.us

Open a help desk ticket