Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • importAll: This function expects a multidimensional array in the format returned from the backup method dumpAll()

    Code Block
    languagephp
    /**
     * Import all from a multidimensional array
     *
     * @param array $data
     * @return void
     */
    $this->importAll([
      'settings' => [],
      'features' => [],
      'tables' => [],
      'kvstore' => []
    ]);


  • importAdvancedSettings: This function expects an array in the format returned from the backup method dumpAdvancedSettings()

    Code Block
    languagephp
    /**
     * Import advanced settings from a multidimensional array
     *
     * @param array $settings
     * @return void
     */
    $this->importAdvancedSettings([
      'KEYWORD' => 'value'
    ]);


  • importFeatureCodes: This function expects an array in the format returned from the backup method dumpFeatureCodes()

    Code Block
    languagephp
    /**
     * Import Feature codes from a multidimensional array
     *
     * @param array $codes
     * @return void
     */
    $this->importFeatureCodes([
      'keyword' => [
        'customcode' => '',
        'enabled' => true
      ]
    ]);


  • importAstDB: Expects a multidimensional array in the format of key => children => child => value

    Code Block
    languagephp
    /**
     * Import Asterisk Database from a multidimensional array
     *
     * @param array $families
     * @return void
     */
    $this->importAstDB([
      'family' => [
        'child' => 'value'
      ]
    ]);


  • importTables: This function expects an array in the format returned from the backup method dumpTables()

    Code Block
    languagephp
    /**
     * Import alltables from a multidimensional array
     *
     * @param array $data
     * @return void
     */
    $this->importAll>importTables([
      'table_from_database' => [
        [
          'col1' => 'val1'
        ]
      ]
    ]);


  • importKVStore: This function expects an array in the format returned from the backup method dumpKVStore()

    Code Block
    languagephp
    /**
     * Import KVStore from a multidimensional array
     *
     * @param array $data
     * @return void
     */
    $this->importKVStore([
      'id' => [
        'key' => 'val'
      ]
    ]);


  • addDataToTableFromArray: This is used by the importTables() method above

    Code Block
    languagephp
    /**
     * Dynamically add data from an array to a table
     *
     * This uses doctrine to see the column names and types to match them up
     * and quote them correctly, if any columns are missing then a warning is displayed
     *
     * @param string $table The table name
     * @param array $data The data to import
     * @param boolean $delete If set to true then delete everything from the table before inserting
     * @return void
     */
    $this->addDataToTableFromArray($table, $data, $delete);


...