You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$rows = $this->db->pq("SELECT s.systemid, s.name, s.description, string_agg(hs.beamlinename) as beamlines FROM bf_system s INNER JOIN bf_system_beamline hs ON s.systemid = hs.systemid " . $where . " GROUP BY s.systemid, s.name, s.description ORDER BY s.name", $args);
# Return a list of components for a system on a beamline
360
351
function_get_components()
361
352
{
362
-
if (!$this->has_arg('sid'))
363
-
$this->_error('No systemid specified');
353
+
if (!$this->has_arg('sid')) {
354
+
$this->_output(array());
355
+
return;
356
+
}
357
+
364
358
$args = array($this->arg('sid'));
365
359
366
360
if ($this->has_arg('bl'))
@@ -381,19 +375,18 @@ function _get_components()
381
375
382
376
$rows = $this->db->pq('SELECT c.componentid, c.name, c.description, string_agg(hc.beamlinename) as beamlines FROM bf_component c INNER JOIN bf_component_beamline hc ON c.componentid = hc.componentid WHERE c.systemid=:1' . $where . ' GROUP BY c.componentid, c.name, c.description ORDER BY beamlines,c.name', $args);
# Return a list of subcomponents for a component on a beamline
393
383
function_get_subcomponents()
394
384
{
395
-
if (!$this->has_arg('cid'))
396
-
$this->_error('No componentid specified');
385
+
if (!$this->has_arg('cid')) {
386
+
$this->_output(array());
387
+
return;
388
+
}
389
+
397
390
$args = array($this->arg('cid'));
398
391
399
392
if ($this->has_arg('bl'))
@@ -414,11 +407,7 @@ function _get_subcomponents()
414
407
415
408
$rows = $this->db->pq('SELECT s.subcomponentid, s.name, s.description, string_agg(hs.beamlinename) as beamlines FROM bf_subcomponent s INNER JOIN bf_subcomponent_beamline hs ON s.subcomponentid = hs.subcomponentid WHERE s.componentid=:1' . $where . ' GROUP BY s.subcomponentid, s.name, s.description ORDER BY s.name', $args);
0 commit comments