Post_Meta_Datastore::get_table_name()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 3
cp 0
crap 2
1
<?php
2
3
namespace Carbon_Fields\Datastore;
4
5
use Carbon_Fields\Field\Field;
6
7
/**
8
 * Post meta (custom fields) datastore class.
9
 */
10
class Post_Meta_Datastore extends Meta_Datastore {
11
12
	/**
13
	 * Retrieve the type of meta data.
14
	 *
15
	 * @return string
16
	 */
17
	public function get_meta_type() {
18
		return 'post';
19
	}
20
21
	/**
22
	 * Retrieve the meta table name to query.
23
	 *
24
	 * @return string
25
	 */
26
	public function get_table_name() {
27
		global $wpdb;
28
		return $wpdb->postmeta;
29
	}
30
31
	/**
32
	 * Retrieve the meta table field name to query by.
33
	 *
34
	 * @return string
35
	 */
36
	public function get_table_field_name() {
37
		return 'post_id';
38
	}
39
}
40