public function getPosts($force_cache_update = false) { $posts = array(); $xml = $this->getXML($force_cache_update); if ($xml != '') { $errors = libxml_use_internal_errors(true); try { $simple_xml = new SimpleXMLElement($xml); foreach ($simple_xml->posts->post as $post) { $posts[] = SniftrPost::factory($post); } } catch (Exception $e) { // ignore SimpleXML parsing exception, just return no posts. } libxml_clear_errors(); libxml_use_internal_errors($errors); } return $posts; }
public function getDate() { return $this->post->getDate(); }