/** * @param array $raw * * @return Taxonomy * * @throws Exception */ protected function do_create_object(array $raw) { $obj = new Taxonomy($raw['term_taxonomy_id']); $term = $this->term_dao->find($raw['term_id']); if (!$term instanceof Term) { $message = sprintf('No term_id %d found for term_taxonomy_id %d in table %s', $raw['term_id'], $raw['term_taxonomy_id'], $this->wpdb->term_taxonomy); throw new Exception($message); } $obj->set_term($term); $parent = $this->get_taxonomy_by_term_id_taxonomy($raw['parent'], $raw['taxonomy']); if ($parent !== null) { $obj->set_parent($parent); } $obj->set_taxonomy($raw['taxonomy']); $obj->set_description($raw['description']); $obj->set_count($raw['count']); return $obj; }