74 return md5(serialize($this->data));
79 if (isset($this->data[
'child'][$namespace][$tag]))
81 return $this->data[
'child'][$namespace][$tag];
91 return $this->item->get_base($element);
96 return $this->item->sanitize(
$data, $type, $base);
108 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
112 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_03_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
143 if (isset($categories[$key]))
145 return $categories[$key];
155 $categories = array();
162 if (isset($category[
'attribs'][
''][
'term']))
166 if (isset($category[
'attribs'][
''][
'scheme']))
170 if (isset($category[
'attribs'][
''][
'label']))
174 $categories[] = $this->registry->create(
'Category', array($term, $scheme, $label));
181 if (isset($category[
'attribs'][
''][
'domain']))
189 $categories[] = $this->registry->create(
'Category', array($term, $scheme, null));
200 if (!empty($categories))
202 return array_unique($categories);
213 if (isset($authors[$key]))
215 return $authors[$key];
235 if (isset($author[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0][
'data']))
239 if (isset($author[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'email'][0][
'data']))
243 if ($name !== null || $email !== null || $uri !== null)
245 $authors[] = $this->registry->create(
'Author', array($name, $uri, $email));
257 if (isset($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data']))
259 $url = $this->
sanitize($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data'],
SIMPLEPIE_CONSTRUCT_IRI, $this->
get_base($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0]));
261 if (isset($author[0][
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'email'][0][
'data']))
265 if ($name !== null || $email !== null || $url !== null)
267 $authors[] = $this->registry->create(
'Author', array($name, $url, $email));
283 if (!empty($authors))
285 return array_unique($authors);
296 if (isset($contributors[$key]))
298 return $contributors[$key];
308 $contributors = array();
318 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0][
'data']))
320 $uri = $this->
sanitize($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0][
'data'],
SIMPLEPIE_CONSTRUCT_IRI, $this->
get_base($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'uri'][0]));
322 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_10][
'email'][0][
'data']))
326 if ($name !== null || $email !== null || $uri !== null)
328 $contributors[] = $this->registry->create(
'Author', array($name, $uri, $email));
340 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data']))
342 $url = $this->
sanitize($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0][
'data'],
SIMPLEPIE_CONSTRUCT_IRI, $this->
get_base($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'url'][0]));
344 if (isset($contributor[
'child'][SIMPLEPIE_NAMESPACE_ATOM_03][
'email'][0][
'data']))
348 if ($name !== null || $email !== null || $url !== null)
350 $contributors[] = $this->registry->create(
'Author', array($name, $url, $email));
354 if (!empty($contributors))
356 return array_unique($contributors);
364 public function get_link($key = 0, $rel =
'alternate')
367 if (isset($links[$key]))
387 if (!isset($this->data[
'links']))
389 $this->data[
'links'] = array();
392 foreach ($links as $link)
394 if (isset($link[
'attribs'][
''][
'href']))
396 $link_rel = (isset($link[
'attribs'][
''][
'rel'])) ? $link[
'attribs'][
''][
'rel'] :
'alternate';
403 foreach ($links as $link)
405 if (isset($link[
'attribs'][
''][
'href']))
407 $link_rel = (isset($link[
'attribs'][
''][
'rel'])) ? $link[
'attribs'][
''][
'rel'] :
'alternate';
426 $keys = array_keys($this->data[
'links']);
427 foreach ($keys as $key)
429 if ($this->registry->call(
'Misc',
'is_isegment_nz_nc', array($key)))
443 $this->data[
'links'][substr($key, 41)] =& $this->data[
'links'][$key];
445 $this->data[
'links'][$key] = array_unique($this->data[
'links'][$key]);
449 if (isset($this->data[
'links'][$rel]))
451 return $this->data[
'links'][$rel];
463 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
467 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_03_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
507 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_10_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
511 return $this->
sanitize($return[0][
'data'], $this->registry->call(
'Misc',
'atom_03_construct_type', array($return[0][
'attribs'])), $this->
get_base($return[0]));
545 elseif (isset($this->data[
'xml_lang']))
559 return (
float) $return[0][
'data'];
563 return (
float) $match[1];
575 return (
float) $return[0][
'data'];
579 return (
float) $return[0][
'data'];
583 return (
float) $match[2];