/** * @param Model $obj * @return array * @throws Exception */ protected function do_create_array(Model $obj) { $parent = 0; if ($obj->get_parent() !== null) { if ($obj->get_parent()->get_term() !== null) { $parent = $obj->get_parent()->get_term()->get_id(); } } $term = $obj->get_term(); if (!$term instanceof Term) { throw new Exception('Taxonomy is missing a valid term.'); } return array('term_id' => $term->get_id(), 'taxonomy' => $obj->get_taxonomy(), 'description' => $obj->get_description(), 'parent' => $parent, 'count' => $obj->get_count()); }
/** * @param Model $obj * @return array */ protected function do_create_array(Model $obj) { $parent = 0; if ($obj->get_parent() !== null) { $parent = $obj->get_parent()->get_id(); } return array('post_author' => $obj->get_author(), 'post_date' => $obj->get_date(), 'post_date_gmt' => $obj->get_date_gmt(), 'post_content' => $obj->get_content(), 'post_title' => $obj->get_title(), 'post_excerpt' => $obj->get_excerpt(), 'post_status' => $obj->get_post_status(), 'comment_status' => $obj->get_comment_status(), 'ping_status' => $obj->get_ping_status(), 'post_password' => $obj->get_password(), 'post_name' => $obj->get_name(), 'to_ping' => $obj->get_to_ping(), 'pinged' => $obj->get_pinged(), 'post_modified' => $obj->get_modified(), 'post_modified_gmt' => $obj->get_modified_gmt(), 'post_content_filtered' => $obj->get_content_filtered(), 'post_parent' => $parent, 'guid' => $obj->get_guid(), 'menu_order' => $obj->get_menu_order(), 'post_type' => $obj->get_type(), 'post_mime_type' => $obj->get_mime_type(), 'comment_count' => $obj->get_comment_count()); }