Page tree
Skip to end of metadata
Go to start of metadata


FreePBX offers a method of storing data without maintaining tables or making direct database calls. 


  • Using the KVStore allows more flexibility in the future if there is a desire to move from mysql to another technology.
  • Using the KVStore allows you to develop without making constant changes to a table that may need to be migrated over and over.
  • The KVStore allows for uniform sanitization keeping the code more secure.


Your class

namespace FreePBX\modules;

class Example extends \DB_Helper{
	public function __construct($freepbx = null){
		if ($freepbx == null) {
			throw new Exception('Not given a FreePBX Object');
		$this->FreePBX = $freepbx;
	public function insertSingle($key,$value){

	public function getSingle($key){
		return $this->getConfig($key);

	public function deleteSingle($key){
	public function insertGroup($id, $itemsArray){
		foreach($itemsArray as $key => $value){
	public function getGroup($id){
		return $this->getAll($id)l
	public function deleteGroup($id){

  • No labels