/** * Constructor * * @param $environment * @param $settingsFilePath * @param array $options * @throws InvalidArgumentException */ public function __construct($environment, $settingsFilePath, array $options = array()) { if (empty($environment)) { throw new InvalidArgumentException('No environment parameter set.'); } if (empty($settingsFilePath)) { throw new InvalidArgumentException('No settings file set.'); } if (!file_exists($settingsFilePath)) { throw new InvalidArgumentException('Could not read settings file.'); } $this->environment = $environment; $this->settingsFilePath = $settingsFilePath; $this->handlerCollection = new Est_HandlerCollection(); if (isset($options['groups'])) { $this->groups = Est_Div::trimExplode(',', $options['groups'], true); } if (isset($options['excludeGroups'])) { $this->excludeGroups = Est_Div::trimExplode(',', $options['excludeGroups'], true); } }
/** * Get tags for given row * * @param array $row * @return array */ protected function getGroupsForRow(array $row) { $tagsColumnIndex = $this->getColumnIndexForEnvironment('GROUPS', true); return $tagsColumnIndex && array_key_exists($tagsColumnIndex, $row) ? Est_Div::trimExplode(',', $row[$tagsColumnIndex]) : array(); }