Get a list of item type elements

I’m using the following to create an array of DC element names:

$itemMetadata = array();		
$dc= get_record('ElementSet',array('name'=>'Dublin Core'));
foreach ($dc->getElements() as $element){

How can I create a similar array of all Item Type Metadata elements?


I think that if you put Item Type Metadata in place of Dublin Core, it should give what you want.

Also, I’m not sure that $dcElements=[]; notation will always work with the minimum PHP requirements for Omeka 2.4. Might be safer to use the older array() notation.

1 Like

Perfect, thanks!

function getElementsForSet($setName){
	$elementSet= get_record('ElementSet',array('name'=>"$setName"));
	foreach ($elementSet->getElements() as $element){
	return $elements;