Completed
Push — master ( 9bbfca...6621c7 )
by J.D.
03:38
created

WordPoints_Entity_Post_Parent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_title() 0 8 1
1
<?php
2
3
/**
4
 * Post parent entity relationship class.
5
 *
6
 * @package WordPoints\Entities
7
 * @since 2.3.0
8
 */
9
10
/**
11
 * Represents the relationship between a Post and its parent Post.
12
 *
13
 * @since 2.3.0
14
 */
15
class WordPoints_Entity_Post_Parent
16
	extends WordPoints_Entity_Relationship_Dynamic_Stored_Field {
17
18
	/**
19
	 * @since 2.3.0
20
	 */
21
	protected $storage_type = 'db';
22
23
	/**
24
	 * @since 2.3.0
25
	 */
26
	protected $primary_entity_slug = 'post';
27
28
	/**
29
	 * @since 2.3.0
30
	 */
31
	protected $related_entity_slug = 'post';
32
33
	/**
34
	 * @since 2.3.0
35
	 */
36
	protected $related_ids_field = 'post_parent';
37
38
	/**
39
	 * @since 2.3.0
40
	 */
41
	public function get_title() {
42
43
		return sprintf(
44
			// translators: Singular post type name.
45
			_x( 'Parent %s', 'post entity', 'wordpoints' )
46
			, parent::get_title()
47
		);
48
	}
49
}
50
51
// EOF
52