Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unneeded comments

  • Loading branch information...
commit af3ef6a775f99be9f10ef75c3ca04dda43142f11 1 parent e060df2
@nb nb authored
Showing with 1 addition and 40 deletions.
  1. +1 −40 classes/class-wpcom-liveblog-entry-query.php
View
41 classes/class-wpcom-liveblog-entry-query.php
@@ -7,12 +7,6 @@
*/
class WPCOM_Liveblog_Entry_Query {
- /**
- * Set the post ID and key when a new object is created
- *
- * @param int $post_id
- * @param string $key
- */
public function __construct( $post_id, $key ) {
global $wp_version;
$this->post_id = $post_id;
@@ -20,7 +14,7 @@ public function __construct( $post_id, $key ) {
}
/**
- * Get the liveblog entries
+ * Query the database for specific liveblog entries
*
* @param array $args the same args for the core `get_comments()`.
* @return array array of `WPCOM_Liveblog_Entry` objects with the found entries
@@ -44,7 +38,6 @@ private function get( $args = array() ) {
* Get all of the liveblog entries
*
* @param array $args the same args for the core `get_comments()`
- * @return array
*/
public function get_all( $args = array() ) {
return self::remove_replaced_entries( $this->get( $args ) );
@@ -59,42 +52,26 @@ public function get_by_id( $id ) {
return $entries[0];
}
- /**
- * Get the latest liveblog entry
- *
- * @return null
- */
public function get_latest() {
- // Get the latest liveblog entry
$entries = $this->get( array( 'number' => 1 ) );
- // Bail if none were found
if ( empty( $entries ) )
return null;
return reset( $entries );
}
- /**
- * Get the latest liveblog timestamp
- *
- * @return mixed Null if error, timestamp if successful
- */
public function get_latest_timestamp() {
- // Get the latest entry
$latest = $this->get_latest();
- // Bail if none were found
if ( is_null( $latest ) )
return null;
- // Bail if not a WPCOM_Liveblog_Entry class
if ( ! is_a( $latest, 'WPCOM_Liveblog_Entry' ) )
return null;
- // Return the timestamp of the latest entry
return $latest->get_timestamp();
}
@@ -126,30 +103,14 @@ private function get_all_entries_asc() {
return $all_entries_asc;
}
- /**
- * Convert each comment into a Liveblog entry
- *
- * @param array $comments
- * @return array
- */
public static function entries_from_comments( $comments = array() ) {
- // Bail if no comments
if ( empty( $comments ) )
return null;
- // Map each comment to a new Liveblog Entry class, so that they inherit
- // some neat helper methods.
return array_map( array( 'WPCOM_Liveblog_Entry', 'from_comment' ), $comments );
}
- /**
- * Filter out entries, which have been replaced by other entries in
- * the same set.
- *
- * @param array $entries
- * @return array
- */
public static function remove_replaced_entries( $entries = array() ) {
if ( empty( $entries ) )
Please sign in to comment.
Something went wrong with that request. Please try again.