UserColumnOrder.php
911 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace AC\Storage;
use AC\Preferences\Site;
use AC\Type\ListScreenId;
class UserColumnOrder {
/**
* @var Site
*/
private $user_preference;
public function __construct() {
$this->user_preference = new Site( 'column_order' );
}
/**
* @param array $column_names
*/
public function save( ListScreenId $id, array $column_names ) {
$this->user_preference->set(
$id->get_id(),
$column_names
);
}
/**
* @param ListScreenId $id
*
* @return bool
*/
public function exists( ListScreenId $id ) {
return null !== $this->get( $id );
}
/**
* @param ListScreenId $id
*
* @return array
*/
public function get( ListScreenId $id ) {
return $this->user_preference->get(
$id->get_id()
);
}
/**
* @param ListScreenId $id
*
* @return void
*/
public function delete( ListScreenId $id ) {
$this->user_preference->delete(
$id->get_id()
);
}
}