<?

class display_settings {

	public $data;

	public function __construct($set_data) {
		$this->data = $set_data;
	}

	public function get_settings($v) {
		$query = 'SELECT * FROM display_settings WHERE display_view = ?';
		return $this->data->get_rows($query, [$v['display_view']]);
	}

	public function set_setting($v=NULL) {
		$object->log($object->toJSON(['insert' => $v]));
		$query = 'DELETE FROM display_settings WHERE property_name = ? AND display_view = ?';
		$this->data->execute($query, [$v['property_name'], $v['display_view']]);

		$insert = $this->data->statement->generate($v, 'display_settings');
		$object->log($insert);
		$this->data->_($insert, $v);
		return ['result' => true];
	}

}

?>