CWIS Developer Documentation
MetadataFieldGroup.php
Go to the documentation of this file.
1 <?PHP
2 #
3 # FILE: MetadataSchema.php
4 #
5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2012-2013 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu/cwis
8 #
9 
15 {
16 
21  public function GetFields()
22  {
23  $ItemIds = $this->GetItemIds();
24  $Items = array();
25 
26  foreach ($ItemIds as $Info)
27  {
28  try
29  {
30  $Items[] = new $Info["Type"]($Info["ID"]);
31  }
32 
33  # skip invalid fields
34  catch (InvalidArgumentException $Exception)
35  {
36  continue;
37  }
38  }
39 
40  return $Items;
41  }
42 
47  public function GetFieldCount()
48  {
49  if (!isset($this->FieldCount))
50  {
51  $this->FieldCount = count($this->GetItemIds());
52  }
53 
54  return $this->FieldCount;
55  }
56 
60  protected $FieldCount;
61 
62 }
GetFieldCount()
Get the number of metadata fields this group holds.
GetItemIds()
Retrieve array of IDs of items in folder, in the order that they appear in the folder.
Definition: Folder.php:299
Class that builds on the foldering functionality to provide groups of metadata fields.
Folder object used to create and manage groups of items.
Definition: Folder.php:17
$FieldCount
The number of metadata fields the group contains.
GetFields()
Get the items of the metadata field group as objects instead of IDs.