/** * Invoke the CSV Import object using a named array to configure behavior parameters. * * Parameters: * - firstline_has_fieldname <boolean> true if first line has field names for the columns * - parent <object> pointer to the invoked add-on object * - plugin <object> pointer to the invoked base plugin (\SLPlus) object * - skip_firstline <boolean> true if the first line does not have data to process * - strip_prefix <string> prefix to strip out of field names if first line has field names * * Example: * $this->importer = new CSVImport(array('parent'=>$this,'plugin'=>$this->plugin)); * * @param mixed[] $params */ function __construct($params) { foreach ($params as $property => $value) { if (property_exists($this, $property)) { $this->{$property} = $value; } } if (isset($this->plugin) && !isset($this->slplus)) { $this->slplus = $this->plugin; } if (isset($this->parent) && !isset($this->addon)) { $this->addon = $this->parent; } if ($this->firstline_has_fieldname) { $this->skip_firstline = true; } $this->slplus->set_php_timeout(); }