Skip to content

Commit c047c69

Browse files
committed
Adjusted the addStatistic for the updated Conf/CodeTable getRowByCode method.
1 parent c5d4718 commit c047c69

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/Users/UserStatistics.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,25 @@ public function addStatistic($typeCode,$categoryCode,$segmentType,$note)
102102
Code Table: UserStatCategories
103103
*/
104104

105-
/* Seems to be an issue with # of categoryCodes that can be pulled at once (max:10) */
106-
/* But performing via curl returns all (???). */
107-
/* May need to open a case to allow resumption on pulling code tables regarding 'limit' and 'offset'? */
105+
# Note need some error checking etc. here.
108106

109-
#
110-
# These functions for CodeTables need defined.
111-
#
112-
#$typeDesc = $this->conf->CodeTables->getDesc('UserStatisticalTypes',$typeCode);
113-
#$categoryDesc = $this->conf->CodeTables->getDesc('UserStatCagegories',$categoryCode);
107+
# Get the Type and Category Descriptions for the codes from the code tables.
108+
$stat = $this->client->conf->codetables->get('UserStatisticalTypes')->getRowByCode($typeCode);
109+
$typeDesc = $stat[0]->description;
110+
111+
$stat = $this->client->conf->codetables->get('UserStatCategories')->getRowByCode($categoryCode);
112+
$categoryDesc = $stat[0]->description;
114113
#
115114
# These are temporary for testing.
116-
$typeDesc = 'Test';
117-
$categoryDesc = 'Test';
115+
#$typeDesc = 'Test';
116+
#$categoryDesc = 'Test';
118117

118+
# Add the statistic:
119119
$this->addStatisticRaw($typeCode,$typeDesc,$categoryCode,$categoryDesc,$segmentType,$note);
120120

121+
# For debugging:
122+
#print "TypeCode: $typeCode\nTypeDesc: $typeDesc\nCategoryCode: $categoryCode\nCategoryDesc: $categoryDesc\n";
123+
121124
}
122125

123126
/**

0 commit comments

Comments
 (0)