Completed
Push — master ( a88a56...6eb92f )
by CodexShaper
11:55
created

Query::setEndpoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Codexshaper\WooCommerce;
4
5
use Codexshaper\WooCommerce\Models\BaseMOdel;
6
use Codexshaper\WooCommerce\Traits\QueryBuilderTrait;
7
8
class Query extends BaseMOdel
9
{
10
	use QueryBuilderTrait;
11
12
	protected $endpoint;
13
	protected static $instance = null;
14
15
	public function __construct($endpoint = '')
16
	{
17
		$this->endpoint = $endpoint;
18
	}
19
20
	public function setEndpoint($endpoint)
21
	{
22
		$this->endpoint = $endpoint;
23
		return $this;
24
	}
25
26
	public function init()
27
	{
28
		if (!static::$instance) {
29
			static::$instance = new static();
30
		}
31
32
		return static::$instance;
33
	}
34
}