public function get_authors_for_posts(array $posts) : array {
        $authorids = array_reduce($posts, function($carry, $post) {
            $carry[$post->get_author_id()] = true;
            return $carry;
        }, []);
        $authorids = array_keys($authorids);
        return $this->get_from_ids($authorids);
    }
public function get_authors_for_posts(array $posts) : array {
        $authorids = array_reduce($posts, function($carry, $post) {
            $carry[$post->get_author_id()] = true;
            return $carry;
        }, []);
        $authorids = array_keys($authorids);
        return $this->get_from_ids($authorids);
    }
public function get_authors_for_posts ( array $ posts ) : array { $ authorids = array_reduce ( $ posts , function ( $ carry , $ post ) { $ carry [ $ post -> get_author_id ( ) ] = true ; return $ carry ; } , [ ] ) ; $ authorids = array_keys ( $ authorids ) ; return $ this -> get_from_ids ( $ authorids ) ; }
Get the authors for the given posts.

Returns a distinct list of authors indexed by author id.

@param post_entity[] $posts The list of posts
@return author_entity[]
Get the authors for the given posts .