Grima 2018-08
Whispering into Alma's ear
Public Member Functions | Public Attributes | List of all members
ItemList Class Reference

class ItemList More...

Inheritance diagram for ItemList:
AlmaObject

Public Member Functions

  __construct ($mms_id, $holding_id, $limit=-1)
 
- Public Member Functions inherited from AlmaObject
  __construct ()
  create new blank Alma Object More...
 
  offsetExists ($offset)
 
  offsetGet ($offset)
 
  offsetSet ($offset, $value)
 
  offsetUnset ($offset)
 

Public Attributes

  $items = array()
 
- Public Attributes inherited from AlmaObject
  $el_access = array()
 
  $xml
 
  $templateDir = __DIR__ . "/templates"
 

Detailed Description

class ItemList

Definition at line 2986 of file grima-lib.php.

Constructor & Destructor Documentation

◆ __construct()

ItemList::__construct (   $mms_id,
  $holding_id,
  $limit = -1 
)

Definition at line 2990 of file grima-lib.php.

2991 {
2992
2993 global $grima;
2994 $curr_offset = 0;
2995 $req_limit = ($limit == -1)?100:$limit;
2996
2997 do {
2998 if ($curr_offset > 0) {
2999 if (($curr_offset+1)*100 > $limit) {
3000 $req_limit = $limit - $curr_offset*100;
3001 } else {
3002 $req_limit = 100;
3003 }
3004 }
3005 $xml = $grima->getItemList($mms_id, $holding_id, $req_limit, $curr_offset*100);
3006 $xpath = new DomXpath($xml);
3007 $is = $xpath->query('//item');
3008 foreach ($is as $i) {
3009 $new_item = new Item();
3010 $new_item->loadFromItemListNode($i);
3011 $this->items[] = $new_item;
3012 }
3013 $xpath = new DomXPath($xml);
3014 if (!$curr_offset) {
3015 $length = $xpath->query('//items/@total_record_count')[0]->nodeValue;
3016 if ($limit == -1) { $limit = $length;
3017 }
3018 }
3019 $curr_offset++;
3020
3021 } while (($curr_offset*100 < $length) and ($curr_offset*100 < $limit));
3022
3023 }
class Item
Definition: grima-lib.php:3501
$grima
Definition: grima-lib.php:5143

References $grima, and AlmaObject\$xml.

Member Data Documentation

◆ $items

ItemList::$items = array()

Definition at line 2988 of file grima-lib.php.


The documentation for this class was generated from the following file: