WordPoints_BP_Entity_Group::get_title()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 3
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Group entity class.
5
 *
6
 * @package WordPoints_BuddyPress
7
 * @since 1.0.0
8
 */
9
10
/**
11
 * Represents a BuddyPress group.
12
 *
13
 * @since 1.0.0
14
 */
15 View Code Duplication
class WordPoints_BP_Entity_Group extends WordPoints_BP_Entity {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
16
17
	/**
18
	 * @since 1.0.0
19
	 */
20
	protected $bp_component = 'groups';
21
22
	/**
23
	 * @since 1.0.0
24
	 */
25
	protected $id_field = 'id';
26
27
	/**
28
	 * @since 1.2.1
29
	 */
30
	protected $id_is_int = true;
31
32
	/**
33
	 * @since 1.0.0
34
	 */
35
	protected $human_id_field = 'name';
36
37
	/**
38
	 * @since 1.0.0
39
	 */
40
	protected function get_entity( $id ) {
41
42
		$entity = groups_get_group( $id );
43
44
		if ( ! $entity->id ) {
45
			return false;
46
		}
47
48
		return $entity;
49
	}
50
51
	/**
52
	 * @since 1.0.0
53
	 */
54
	public function get_title() {
55
		return _x( 'Group', 'group entity', 'wordpoints-bp' );
56
	}
57
}
58
59
// EOF
60