ListScreen.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Admin\Preference; |
| 4 | |
| 5 | use AC\Preferences\Site; |
| 6 | |
| 7 | class ListScreen extends Site { |
| 8 | |
| 9 | const OPTION_LAST_VISITED = 'last_visited_list_key'; |
| 10 | |
| 11 | public function __construct( $is_network = false ) { |
| 12 | parent::__construct( $is_network ? 'network_settings' : 'settings' ); |
| 13 | } |
| 14 | |
| 15 | public function get_last_visited_list_key() { |
| 16 | return $this->get( self::OPTION_LAST_VISITED ); |
| 17 | } |
| 18 | |
| 19 | public function set_last_visited_list_key( $list_key ) { |
| 20 | $this->set( self::OPTION_LAST_VISITED, $list_key ); |
| 21 | } |
| 22 | |
| 23 | public function set_list_id( $list_key, $list_id ) { |
| 24 | $this->set( (string) $list_key, (string) $list_id ); |
| 25 | } |
| 26 | |
| 27 | public function get_list_id( $list_key ) { |
| 28 | return $this->get( $list_key ); |
| 29 | } |
| 30 | |
| 31 | } |