Importer
MMO\core\entities · 1 symbol · generated 5 Oct 2026
Importer
Importer.php:178Class used to import a list of raw data (organized in a map) into a list of entities.
- Namespace
MMO\core\entities- Implements
- JsonSerializable
Index
| UNDEFINED | ||
| coercer | coercer to use to transform the raw data | |
| commit | ||
| errors | ||
| mapping | map of the mapping {source-path: [dest-path, type, options]} | |
| maxEmptyRows | define the max number of empty data encounter before stopping import | |
| options | ||
| relations | map of the relations {variable-name: list of target path}. | |
| replaceEntity | ||
| repositories | map of iRepository {name: iRepository} | |
| variables | map of variables {name: Collection} | |
| FromConfig($config, $debug) static | Load a configuration from a json file or an array. | |
| FromMultipleConfigs($configs, $debug) static | Load multiple importer from a json file or an array | |
| getMapping() | ||
| getOption($name, $key, $default) | ||
| getOptions($name) | ||
| getRelations() | ||
| getRepositories() | ||
| getRepository($id) | ||
| getVariablePaths($name) | ||
| getVariableRepositoryName($name) | ||
| getVariables() | ||
| getVariablesPaths() | ||
| hasVariable($name) | ||
| ignore($row, $key, $replaceBy) | Remove entity from import NOTE: the ``-suffixed (list relation) branch had two compounding bugs: (1) it passed $path to | |
| isValidPath($path) | Check if a path is valid for a given entity variable | |
| jsonSerialize() | ||
| loadXlsx($doc, $info, $debug) | Load importer configuration from xlsx document The document needs to have these pages: - Import on which the first line is a title for the column and the second line is the target path for the co… | |
| loopData($data, $options) | Loop through the rows of data | |
| loopXlsx($doc, $info, $debug) | Load an xlsx's configuration (loadXlsx) and import its data rows (the 'Import' sheet, starting at row 3 -- rows 1-2 are the column titles/target-path header, per loadXlsx). | |
| removeVariable($name) | Undeclare a variable (its mapping/relations/options, if any, are left in place -- only the variable itself is forgotten). | |
| RepositoryController($coercer) static | Build an Importer using every repository the app's RepositoryController already knows about. | |
| setMap($srcPath, $destPath, $type, $opts) | Declare how one source data path maps to one or more destination variable paths (the class docblock's "Mapping" section). | |
| setMapping($mapping, $debug) | Replace the whole mapping. | |
| setOptions($name, $options) | Replace variable $name's options (getOption -- e.g. | |
| setRelation($variable, $paths) | Declare where variable $variable itself belongs, within one or more OTHER variables (the class docblock's "Relations" section -- a path ending in `` pushes it into a list instead of a direct p… | |
| setRelations($relations, $debug) | ||
| setRepositories($repositories) | Replace every registered repository. | |
| setRepository($repo, $id) | Register a repository under $id (default 'main'). | |
| setVariable($name, $collection, $repository) | Declare an import variable and the collection its entities are created in. | |
| setVariables($variables, $debug) | Set the variables to import | |
| __construct($repositories, $coercer) | Constructor |