/** * Constructeur * * @param Conf $conf Configuration for the csv parse (length, * delimiter, enclosure) * @param Columns $columns Configuration des colonnes * @param string $connection Chemin du fichier csv * * @throws Exception Si le fichier source n'existe pas ou n'est pas lisible */ public function __construct(Conf $conf, Columns $columns, $connection) { parent::__construct($conf, $columns, $connection); if (!file_exists($this->connection)) { throw new Exception('No csv file founed : "' . $connection . '"'); } if (!is_readable($this->connection)) { throw new Exception('Csv file not readable : "' . realpath($connection) . '"'); } if (!isset($this->conf->length)) { $this->conf->length = 0; } if (!isset($this->conf->delimiter)) { $this->conf->delimiter = ','; } if (!isset($this->conf->enclosure)) { $this->conf->enclosure = '"'; } }
/** * Constructor * * @param Conf $conf The configuration * @param Columns $columns The columns configuration * @param DoctrineConnection $connection The connection */ public function __construct(Conf $conf, Columns $columns, DoctrineConnection $connection) { parent::__construct($conf, $columns, $connection); $this->buildQuery(); }
/** * Constructor * * @param Conf $conf The configuration * @param Columns $columns The columns configuration * @param EntityManager $connection The entity manager */ public function __construct(Conf $conf, Columns $columns, EntityManager $connection) { parent::__construct($conf, $columns, $connection); $this->buildQuery(); }