private function _loadComments() { $youtube = new YouTube($this->_developerKey); $data = $youtube->getComments($this->_id, $this->_maxResults, $this->_startIndex); $xml = new SimpleXMLElement($data); //fetch comments $this->_comments = array(); foreach ($xml->entry as $entry) { $comment = new YouTubeVideoComment($entry); $this->_comments[] = $comment; } //fetch list data $namespaces = $xml->getNameSpaces(true); if ($namespaces) { $openSearch = $entry->children($namespaces['openSearch']); } else { return FALSE; } $this->_totalVideos = (int) $openSearch->totalResults; $this->_startIndex = (int) $openSearch->startIndex; $this->_maxResults = (int) $openSearch->itemsPerPage; if ($this->_comments) { return TRUE; } /* else */ return FALSE; }