jenkins-bot has submitted this change and it was merged. Change subject: Add shortcut to get value by name from current row ......................................................................
Add shortcut to get value by name from current row Who wants to repeat that 2nd argument, anyway? Change-Id: If71fcf4bce14c5fc49ff30e7fcf70aeef0e9dcde --- M Core/DataFiles/HeadedCsvReader.php 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/Core/DataFiles/HeadedCsvReader.php b/Core/DataFiles/HeadedCsvReader.php index bf0babb..0bddbc8 100644 --- a/Core/DataFiles/HeadedCsvReader.php +++ b/Core/DataFiles/HeadedCsvReader.php @@ -46,6 +46,18 @@ } /** + * Convenience function to extract a column's value from the current row + * + * @param string $colName Name of the column to extract + * + * @throws DataFileException if the column name does not exist. + * @return string Contents of the column + */ + public function currentCol( $colName ) { + return $this->extractCol( $colName, $this->currentElement ); + } + + /** * @return string[] CSV file headers in order of columns */ public function headers() { -- To view, visit https://gerrit.wikimedia.org/r/242590 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If71fcf4bce14c5fc49ff30e7fcf70aeef0e9dcde Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: Awight <awi...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits