added prototype backward compability
This commit is contained in:
parent
b938015300
commit
b3bda8226b
3 changed files with 15 additions and 5 deletions
|
@ -70,7 +70,16 @@ class DataController extends Controller {
|
|||
|
||||
public function run($operation, array $identifiers = array()) {
|
||||
$ec = new EntityController($this->view, $this->em);
|
||||
$identifiers[0] = $ec->get($identifiers[0]);
|
||||
|
||||
if (count($identifiers) == 2) { // prototype: backend/data/uuid/port.json
|
||||
$identifiers[0] = $ec->filter(array(
|
||||
'cuuid' => $identifiers[0],
|
||||
'port' => $identifiers[1]
|
||||
));
|
||||
}
|
||||
elseif (count($identifiers) == 1) { // assume UUID
|
||||
$identifiers[0] = $ec->get($identifiers[0]);
|
||||
}
|
||||
|
||||
return parent::run($operation, $identifiers);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
{
|
||||
"name" : "power",
|
||||
"required" : ["title", "resolution"],
|
||||
"optional" : ["description", "details:", "owner:", "address:", "tolerance"],
|
||||
"optional" : ["description", "details:", "owner:", "address:", "tolerance", "port", "cuuid"],
|
||||
"icon" : "", // TODO look for an icon
|
||||
"unit" : "kW/h",
|
||||
"interpreter" : "Volkszaehler\\Interpreter\\MeterInterpreter",
|
||||
|
@ -57,7 +57,7 @@
|
|||
{
|
||||
"name" : "gas",
|
||||
"required" : ["title", "resolution"],
|
||||
"optional" : ["description", "details:", "owner:", "address:", "tolerance"],
|
||||
"optional" : ["description", "details:", "owner:", "address:", "tolerance", "port", "cuuid"],
|
||||
"icon" : "", // TODO look for an icon
|
||||
"unit" : "m³/h",
|
||||
"interpreter" : "Volkszaehler\\Interpreter\\MeterInterpreter",
|
||||
|
@ -67,7 +67,7 @@
|
|||
{
|
||||
"name" : "water",
|
||||
"required" : ["title", "resolution"],
|
||||
"optional" : ["description", "details:", "owner:", "address:", "tolerance"],
|
||||
"optional" : ["description", "details:", "owner:", "address:", "tolerance", "port", "cuuid"],
|
||||
"icon" : "", // TODO look for an icon
|
||||
"unit" : "m³/h",
|
||||
"interpreter" : "Volkszaehler\\Interpreter\\MeterInterpreter",
|
||||
|
|
|
@ -300,7 +300,8 @@
|
|||
{
|
||||
"name" : "cuuid",
|
||||
"type" : "string",
|
||||
"max" : 37,
|
||||
"max" : 36,
|
||||
"pattern" : "/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/",
|
||||
"translation" : { "de" : "Cotroller UUID" }
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue