public function get_schema_map()
{
if (empty($this->schema)) {
$default_fields = Post::default_fields();
$schema = array('posts' => array_combine(array_keys($default_fields), array_keys($default_fields)));
$schema['*'] = array();
$fields = array_merge($this->fields, $this->newfields);
foreach ($fields as $field => $value) {
if (!isset($default_fields[$field])) {
$schema['*'][$field] = $field;
}
}
$schema = Plugins::filter('post_schema_map_' . Utils::slugify(Post::type_name($fields['content_type']), '_'), $schema, $this);
$schema = Plugins::filter('post_schema_map', $schema, $this);
$this->schema = $schema;
}
return $this->schema;
}