Base.php
854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace WPML\Rest;
use IWPML_Action;
abstract class Base implements ITarget, IWPML_Action {
/** @var Adaptor */
private $adaptor;
public function __construct( Adaptor $adaptor ) {
$this->adaptor = $adaptor;
$adaptor->set_target( $this );
}
/**
* @return string
*/
abstract public function get_namespace();
public function add_hooks() {
$this->adaptor->add_hooks();
}
/**
* @return array
*/
public static function getStringType() {
return [
'type' => 'string',
'sanitize_callback' => 'WPML_REST_Arguments_Sanitation::string',
];
}
/**
* @return array
*/
public static function getIntType() {
return [
'type' => 'int',
'validate_callback' => 'WPML_REST_Arguments_Validation::integer',
'sanitize_callback' => 'WPML_REST_Arguments_Sanitation::integer',
];
}
}