32 if (!property_exists($precedingItem,
"author")) {
36 if (count($precedingItem->author) !== count($currentAuthor)) {
39 foreach ($currentAuthor as $current) {
40 if (self::precedingHasAuthor($precedingItem, $current)) {
55 foreach ($preceding->author as $author) {
56 if ($author->family === $name->family && $author->given === $name->given) {
72 if (isset($data->{$particle}) && isset($data->{$namePart})) {
73 $data->{$namePart} = $data->{$namePart}.
" ".$data->{$particle};
74 unset($data->{$particle});
86 if (isset($data->{$particle}) && isset($data->{$namePart})) {
87 $data->{$namePart} = $data->{$particle}.
" ".$data->{$namePart};
88 unset($data->{$particle});
97 public static function sameNames($persons1, $persons2)
99 $same = count($persons1) === count($persons2);
105 array_walk($persons1,
function($name, $key) use ($persons2, &$same) {
106 $family1 = $name->family;
107 $family2 = $persons2[$key]->family;
108 $same = $same && ($family1 === $family2);
121 if (empty($data->family)) {
124 return $data->family.(isset($data->given) ? $data->given :
"");
129 $markupExtension = CiteProc::getContext()->getMarkupExtension();
130 if (array_key_exists($nameVar, $markupExtension)) {
131 $function = $markupExtension[$nameVar];
132 if (is_callable($function)) {
133 return $function($nameItem, $formattedName);
135 } elseif (array_key_exists($mode = CiteProc::getContext()->getMode(), $markupExtension)) {
136 if (array_key_exists($nameVar, $markupExtension[$mode])) {
137 $function = $markupExtension[$mode][$nameVar];
138 if (is_callable($function)) {
139 return $function($nameItem, $formattedName);
143 return $formattedName;