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

class Item More...

Inheritance diagram for Item:
AlmaObject

Public Member Functions

 loadFromAlma ($mms_id, $holding_id, $item_pid)
 populates item record from Alma More...
 
 loadFromAlmaX ($item_pid)
 populates item record from Alma, only needs item_pid More...
 
 loadFromAlmaBarcode ($barcode)
 populates item record from Alma, using barcode More...
 
 loadFromAlmaBCorX ($id)
 populates item record from Alma using either identifier More...
 
 loadFromItemListNode ($node)
 populate item record from the information in an ItemList node More...
 
 addToAlmaHolding ($mms_id, $holding_id)
 add new item record to holding in Alma More...
 
 updateAlma ()
 replace item record in Alma More...
 
 deleteFromAlma ($override="false", $holdings="retain")
 delete record from Alma More...
 
- Public Member Functions inherited from AlmaObject
 __construct ()
 create new blank Alma Object More...
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 

Public Attributes

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

Detailed Description

class Item

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

Member Function Documentation

◆ addToAlmaHolding()

Item::addToAlmaHolding (   $mms_id,
  $holding_id 
)

add new item record to holding in Alma

Parameters
string$mms_idMMS ID of bib record
string$holding_idHolding ID of holding record to add item to
Returns
DomDocument item object as it now appears in Alma

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

References $grima, and AlmaObject\$xml.

2569  {
2570  global $grima;
2571  $this->mms_id = $mms_id;
2572  $this->holding_id = $holding_id;
2573  $this->xml = $grima->postItem($mms_id,$holding_id,$this->xml);
2574  return $this->xml;
2575  }
$grima
Definition: grima-lib.php:1166

◆ deleteFromAlma()

Item::deleteFromAlma (   $override = "false",
  $holdings = "retain" 
)

delete record from Alma

Parameters
string$overrideshould the item be deleted even if warnings exist? (default false)
string$holdingsmethod for handling holdings record left with no items (retain, delete, suppress)

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

References $grima.

2601  {
2602  global $grima;
2603  $grima->deleteItem($this['mms_id'],$this['holding_id'],$this['item_pid'],$override,$holdings);
2604  }
$grima
Definition: grima-lib.php:1166

◆ loadFromAlma()

Item::loadFromAlma (   $mms_id,
  $holding_id,
  $item_pid 
)

populates item record from Alma

Parameters
string$mms_idMMS ID of bib record
string$holding_idHolding ID of holding record
string$item_pidItem ID of item record

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

References $grima.

2504  {
2505  global $grima;
2506  $this->xml = $grima->getItem($mms_id,$holding_id,$item_pid);
2507  }
$grima
Definition: grima-lib.php:1166

◆ loadFromAlmaBarcode()

Item::loadFromAlmaBarcode (   $barcode)

populates item record from Alma, using barcode

Parameters
string$barcodebarcode of record to load from Alma

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

References $grima.

Referenced by loadFromAlmaBCorX().

2526  {
2527  global $grima;
2528  $this->xml = $grima->getItemBC($barcode);
2529  }
$grima
Definition: grima-lib.php:1166

◆ loadFromAlmaBCorX()

Item::loadFromAlmaBCorX (   $id)

populates item record from Alma using either identifier

Parameters
string$ididentifer of record to load from Alma (can be barcode or item ID)

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

References $grima, loadFromAlmaBarcode(), and loadFromAlmaX().

2539  {
2540  global $grima;
2541  if (preg_match("/^23.*/",$id)) { # item_pid
2542  # probably should know about suffix too
2543  $this->loadFromAlmaX($id);
2544  } else {
2545  $this->loadFromAlmaBarcode($id);
2546  }
2547  }
loadFromAlmaBarcode($barcode)
populates item record from Alma, using barcode
Definition: grima-lib.php:2526
$grima
Definition: grima-lib.php:1166
loadFromAlmaX($item_pid)
populates item record from Alma, only needs item_pid
Definition: grima-lib.php:2515

◆ loadFromAlmaX()

Item::loadFromAlmaX (   $item_pid)

populates item record from Alma, only needs item_pid

Parameters
string$item_piditem ID of record to load from Alma

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

References $grima.

Referenced by loadFromAlmaBCorX().

2515  {
2516  global $grima;
2517  $this->xml = $grima->getItem('X','X',$item_pid);
2518  }
$grima
Definition: grima-lib.php:1166

◆ loadFromItemListNode()

Item::loadFromItemListNode (   $node)

populate item record from the information in an ItemList node

Parameters
DomNode$nodenode from an ItemList

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

2556  {
2557  $this->xml = new DomDocument();
2558  $this->xml->appendChild($this->xml->importNode($node,true));
2559  }

◆ updateAlma()

Item::updateAlma ( )

replace item record in Alma

Returns
DomDocument item object as it now appears in Alma

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

References $grima.

2583  {
2584  global $grima;
2585  return $grima->putItem(
2586  $this['mms_id'],
2587  $this['holding_id'],
2588  $this['item_pid'],
2589  $this->xml
2590  );
2591  }
$grima
Definition: grima-lib.php:1166

Member Data Documentation

◆ $el_address

Item::$el_address

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


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