/** * constructs a new importer from given config * * @param array $_options * @throws Tinebase_Exception_InvalidArgument */ public function __construct(array $_options = array()) { $this->_options = array_merge($this->_options, array('maxLineLength' => 8000, 'delimiter' => ',', 'enclosure' => '"', 'escape' => '\\', 'encodingTo' => 'UTF-8', 'mapping' => '', 'headline' => 0, 'use_headline' => 1, 'mapUndefinedFieldsEnable' => 0, 'mapUndefinedFieldsTo' => 'description')); parent::__construct($_options); if (empty($this->_options['model'])) { throw new Tinebase_Exception_InvalidArgument(get_class($this) . ' needs model in config.'); } $this->_setController(); }
/** * constructs a new importer from given config * * @param array $_options */ public function __construct(array $_options = array()) { parent::__construct($_options); if (empty($this->_options['model'])) { throw new Tinebase_Exception_InvalidArgument(get_class($this) . ' needs model in config.'); } $this->_setController(); // don't set geodata for imported contacts as this is too much traffic for the nominatim server $this->_controller->setGeoDataForContacts(FALSE); // get container id from default container if not set if (empty($this->_options['container_id'])) { $defaultContainer = $this->_controller->getDefaultAddressbook(); $this->_options['container_id'] = $defaultContainer->getId(); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Setting default container id: ' . $this->_options['container_id']); } } }