This file contains the class to import a competency framework.
More...
|
| | __construct ($text=null, $encoding=null, $delimiter=null, $importid=0, $mappingdata=null, $useprogressbar=false) |
| | Constructor - parses the raw text for sanity. More...
|
| |
| | add_children (& $node, $parentidnumber) |
| | Add a competency to the parent with the specified idnumber. More...
|
| |
| | create_competency ($record, $parent, $framework) |
| | Recursive function to add a competency with all it's children. More...
|
| |
| | fail ($msg) |
| | Store an error message for display later. More...
|
| |
| | get_error () |
| | Get parse errors. More...
|
| |
| | get_importid () |
| | Get the CSV import id. More...
|
| |
| | get_scale_configuration ($scaleid, $config) |
| | Recreate the scale config to point to a new scaleid. More...
|
| |
| | get_scale_id ($scalevalues, $competencyname) |
| | Search for a global scale that matches this set of scalevalues. More...
|
| |
| | import () |
| | Do the job. More...
|
| |
| | list_found_headers () |
| | Get the list of headers found in the import. More...
|
| |
|
|
string | $error = '' |
| | $error The errors message from reading the xml
|
| |
|
array | $flat = array() |
| | $flat The flat competencies tree
|
| |
|
| $foundheaders = array() |
| |
|
array | $framework = array() |
| | $framework The framework info
|
| |
|
| $importer = null |
| |
|
| $importid = 0 |
| |
|
| $mappings = array() |
| |
|
core progress display_if_slow null | $progress = null |
| | $progress The progress bar instance.
|
| |
|
| $scalecache = array() |
| |
|
bool | $useprogressbar = false |
| | $useprogressbar Control whether importing should use progress bars or not.
|
| |
This file contains the class to import a competency framework.
- Copyright
- 2015 Damyon Wiese
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
| tool_lpimportcsv\framework_importer::__construct |
( |
|
$text = null, |
|
|
|
$encoding = null, |
|
|
|
$delimiter = null, |
|
|
|
$importid = 0, |
|
|
|
$mappingdata = null, |
|
|
|
$useprogressbar = false |
|
) |
| |
Constructor - parses the raw text for sanity.
- Parameters
-
| string | $text | The raw csv text. |
| string | $encoding | The encoding of the csv file. |
| string | delimiter The specified delimiter for the file. |
| string | importid The id of the csv import. |
| array | mappingdata The mapping data from the import form. |
| bool | $useprogressbar | Whether progress bar should be displayed, to avoid html output on CLI. |
◆ add_children()
| tool_lpimportcsv\framework_importer::add_children |
( |
& |
$node, |
|
|
|
$parentidnumber |
|
) |
| |
Add a competency to the parent with the specified idnumber.
- Parameters
-
| competency | $node | (pass by reference) |
| string | $parentidnumber | Add this competency to the parent with this idnumber. |
◆ create_competency()
| tool_lpimportcsv\framework_importer::create_competency |
( |
|
$record, |
|
|
|
$parent, |
|
|
|
$framework |
|
) |
| |
Recursive function to add a competency with all it's children.
- Parameters
-
| stdClass | $record | Raw data for the new competency |
| competency | $parent | |
| competency_framework | $framework | |
◆ fail()
| tool_lpimportcsv\framework_importer::fail |
( |
|
$msg | ) |
|
Store an error message for display later.
- Parameters
-
◆ get_column_data()
| tool_lpimportcsv\framework_importer::get_column_data |
( |
|
$row, |
|
|
|
$index |
|
) |
| |
|
protected |
Get the a column from the imported data.
- Parameters
-
| array | The imported raw row |
| index | The column index we want |
- Return values
-
◆ get_error()
| tool_lpimportcsv\framework_importer::get_error |
( |
| ) |
|
Get parse errors.
- Return values
-
| array | of errors from parsing the xml. |
◆ get_importid()
| tool_lpimportcsv\framework_importer::get_importid |
( |
| ) |
|
Get the CSV import id.
- Return values
-
◆ get_scale_configuration()
| tool_lpimportcsv\framework_importer::get_scale_configuration |
( |
|
$scaleid, |
|
|
|
$config |
|
) |
| |
Recreate the scale config to point to a new scaleid.
- Parameters
-
| int | $scaleid | |
| string | $config | json encoded scale data. |
◆ get_scale_id()
| tool_lpimportcsv\framework_importer::get_scale_id |
( |
|
$scalevalues, |
|
|
|
$competencyname |
|
) |
| |
Search for a global scale that matches this set of scalevalues.
If one is not found it will be created.
- Parameters
-
| array | $scalevalues | |
| string | $competencyname | (Used to create a new scale if required) |
- Return values
-
◆ import()
| tool_lpimportcsv\framework_importer::import |
( |
| ) |
|
Do the job.
- Return values
-
◆ list_found_headers()
| tool_lpimportcsv\framework_importer::list_found_headers |
( |
| ) |
|
Get the list of headers found in the import.
- Return values
-
| array | The found headers (names from import) |
◆ list_required_headers()
| static tool_lpimportcsv\framework_importer::list_required_headers |
( |
| ) |
|
|
static |
Get the list of headers required for import.
- Return values
-
| array | The headers (lang strings) |
◆ read_mapping_data()
| tool_lpimportcsv\framework_importer::read_mapping_data |
( |
|
$data | ) |
|
|
protected |
Read the data from the mapping form.
- Parameters
-
◆ set_related()
| tool_lpimportcsv\framework_importer::set_related |
( |
|
$record | ) |
|
|
protected |
Walk through the idnumbers in the relatedidnumbers col and set the relations.
- Parameters
-
◆ set_rules()
| tool_lpimportcsv\framework_importer::set_rules |
( |
|
$record | ) |
|
|
protected |
Create any completion rule attached to this competency.
- Parameters
-
The documentation for this class was generated from the following file: