Skip to content

Commit e3dcc84

Browse files
committed
Updating CodeTables.php
1 parent e2ed242 commit e3dcc84

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

src/Conf/CodeTables.php

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class CodeTables
1414

1515
/* @var Client */
1616
protected $client;
17+
18+
protected $codeTables;
1719

1820
public function __construct(Client $client)
1921
{
@@ -27,7 +29,9 @@ public function __construct(Client $client)
2729
*/
2830
public function getCodeTable($codetable)
2931
{
30-
return json_decode($this->client->get($this->urlBase()."/$codetable"));
32+
$codeTable = json_decode($this->client->get($this->urlBase()."/$codetable"));
33+
return($codeTable);
34+
#return json_decode($this->client->get($this->urlBase()."/$codetable"));
3135
}
3236

3337

@@ -44,11 +48,26 @@ public function getCodeTableRowByCode($codetable,$code)
4448
echo "CodeTable: $codetable\n";
4549
echo "Code: $code\n";
4650
$count = 0;
47-
foreach ($this->getCodeTable($codetable) as $row) {
48-
$count++;
51+
$found = array();
52+
$my_codetable = $this->getCodeTable($codetable);
53+
var_dump($my_codetable);
54+
$rows = $my_codetable->row;
55+
56+
print "Name: $name - Desc: $desc\n";
57+
58+
foreach ($rows as $row) {
59+
#var_dump($row);
60+
if ($row->code == $code) {
61+
array_push($found,$row);
62+
$count++;
63+
}
4964
}
50-
print "Total Rows in $codetable: $count\n";
51-
return;
65+
print "Total Found Rows in $codetable: $count\n";
66+
67+
print "Found:\n";
68+
var_dump($found);
69+
70+
return($found);
5271
}
5372

5473

@@ -59,7 +78,9 @@ public function getCodeTableRowByCode($codetable,$code)
5978
*/
6079
public function getCodeTables()
6180
{
62-
return json_decode($this->client->get($this->urlBase()));
81+
$this->codeTables = json_decode($this->client->get($this->urlBase()));
82+
return($this->codeTables);
83+
#return json_decode($this->client->get($this->urlBase()));
6384
}
6485

6586
/**

0 commit comments

Comments
 (0)