AnsPress_Reputation_Query::prefetch()

Description #

Prefetch related items.

Source #

File: includes/reputation.php

	public function prefetch() {
		foreach ( (array) $this->reputations as $key => $rep ) {
			$event = $this->events[ $rep->rep_event ];

			if ( ! isset( $this->ids[ $event['parent'] ] ) ) {
				$this->ids[ $event['parent'] ] = array();
			}

			$this->ids[ $event['parent'] ][]   = $rep->rep_ref_id;
			$this->reputations[ $key ]->parent = $event['parent'];
			$this->pos[ $rep->rep_ref_id ]     = $key;
		}

		$this->prefetch_posts();
		$this->prefetch_comments();
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment