-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from beatrycze-volk/implment-part
Implement functions in Part class and its child element classes
- Loading branch information
Showing
6 changed files
with
152 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,30 +17,13 @@ | |
|
||
/** | ||
* Detail MODS metadata element class for the 'php-mods-reader' library. | ||
* @see https://www.loc.gov/standards/mods/userguide/part.html#detail | ||
* | ||
* @access public | ||
*/ | ||
class Detail extends BaseElement | ||
{ | ||
|
||
/** | ||
* @access private | ||
* @var LanguageElement | ||
*/ | ||
private LanguageElement $number; | ||
|
||
/** | ||
* @access private | ||
* @var LanguageElement | ||
*/ | ||
private LanguageElement $caption; | ||
|
||
/** | ||
* @access private | ||
* @var LanguageElement | ||
*/ | ||
private LanguageElement $title; | ||
|
||
/** | ||
* This extracts the essential MODS metadata from XML | ||
* | ||
|
@@ -56,7 +39,8 @@ public function __construct(\SimpleXMLElement $xml) | |
} | ||
|
||
/** | ||
* Get the value of type | ||
* Get the value of the 'type' attribute. | ||
* @see https://www.loc.gov/standards/mods/userguide/part.html#detailtype | ||
* | ||
* @access public | ||
* | ||
|
@@ -68,7 +52,8 @@ public function getType(): string | |
} | ||
|
||
/** | ||
* Get the value of level | ||
* Get the value of the 'level' attribute. | ||
* @see https://www.loc.gov/standards/mods/userguide/part.html#level | ||
* | ||
* @access public | ||
* | ||
|
@@ -80,38 +65,47 @@ public function getLevel(): int | |
} | ||
|
||
/** | ||
* Get the value of number | ||
* Get the array of the <number> elements. | ||
* @see https://www.loc.gov/standards/mods/userguide/part.html#number | ||
* | ||
* @access public | ||
* | ||
* @param string $query The XPath query for metadata search | ||
* | ||
* @return LanguageElement | ||
*/ | ||
public function getNumber(): LanguageElement | ||
public function getNumbers(string $query = ''): array | ||
Check failure on line 77 in src/Mods/Element/Specific/Part/Detail.php
|
||
{ | ||
return $this->number; | ||
return $this->getLanguageElements('./mods:number' . $query); | ||
} | ||
|
||
/** | ||
* Get the value of caption | ||
* Get the array of the <caption> elements. | ||
* @see https://www.loc.gov/standards/mods/userguide/part.html#caption | ||
* | ||
* @access public | ||
* | ||
* @param string $query The XPath query for metadata search | ||
* | ||
* @return LanguageElement | ||
*/ | ||
public function getCaption(): LanguageElement | ||
public function getCaptions(string $query = ''): array | ||
{ | ||
return $this->caption; | ||
return $this->getLanguageElements('./mods:caption' . $query); | ||
} | ||
|
||
/** | ||
* Get the value of title | ||
* Get the array of the <title> elements. | ||
* @see https://www.loc.gov/standards/mods/userguide/part.html#title | ||
* | ||
* @access public | ||
* | ||
* @param string $query The XPath query for metadata search | ||
* | ||
* @return LanguageElement | ||
*/ | ||
public function getTitle(): LanguageElement | ||
public function getTitles(string $query = ''): array | ||
{ | ||
return $this->title; | ||
return $this->getLanguageElements('./mods:title' . $query); | ||
} | ||
} |
Oops, something went wrong.