/** * @param array $raw * @return Post */ protected function do_create_object(array $raw) { $obj = new Post($raw['ID']); if (($parent = $this->find($raw['post_parent'])) !== null) { $obj->set_parent($parent); } $obj->set_author($raw['post_author']); $obj->set_date($raw['post_date']); $obj->set_date_gmt($raw['post_date_gmt']); $obj->set_modified($raw['post_modified']); $obj->set_modified_gmt($raw['post_modified_gmt']); $obj->set_content($raw['post_content']); $obj->set_title($raw['post_title']); $obj->set_excerpt($raw['post_excerpt']); $obj->set_post_status($raw['post_status']); $obj->set_comment_status($raw['comment_status']); $obj->set_ping_status($raw['ping_status']); $obj->set_password($raw['post_password']); $obj->set_name($raw['post_name']); $obj->set_to_ping($raw['to_ping']); $obj->set_pinged($raw['pinged']); $obj->set_content_filtered($raw['post_content_filtered']); $obj->set_guid($raw['guid']); $obj->set_menu_order($raw['menu_order']); $obj->set_type($raw['post_type']); $obj->set_mime_type($raw['post_mime_type']); $obj->set_comment_count($raw['comment_count']); return $obj; }