|
@@ 66-78 (lines=13) @@
|
| 63 |
|
|
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
public function byId(Process $daemon, $id) { |
| 67 |
|
|
| 68 |
|
$data = self::getManager($daemon)->getOne(['id' => $id]); |
| 69 |
|
|
| 70 |
|
if ( empty($data) ) return null; |
| 71 |
|
|
| 72 |
|
$resource = new Item($data, new Transformer); |
| 73 |
|
$fractal = new FractalManager(); |
| 74 |
|
$data = $fractal->createData($resource)->toArray(); |
| 75 |
|
|
| 76 |
|
return $data['data']; |
| 77 |
|
|
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
public function byJid(Process $daemon, $jid) { |
| 81 |
|
|
|
@@ 80-90 (lines=11) @@
|
| 77 |
|
|
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
public function byJid(Process $daemon, $jid) { |
| 81 |
|
|
| 82 |
|
$data = self::getManager($daemon)->get(['jid' => $jid]); |
| 83 |
|
|
| 84 |
|
$resource = new Collection($data, new Transformer); |
| 85 |
|
$fractal = new FractalManager(); |
| 86 |
|
$data = $fractal->createData($resource)->toArray(); |
| 87 |
|
|
| 88 |
|
return $data['data']; |
| 89 |
|
|
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function byUid(Process $daemon, $uid) { |
| 93 |
|
|
|
@@ 92-104 (lines=13) @@
|
| 89 |
|
|
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
public function byUid(Process $daemon, $uid) { |
| 93 |
|
|
| 94 |
|
$data = self::getManager($daemon)->getOne(['uid' => $uid]); |
| 95 |
|
|
| 96 |
|
if ( empty($data) ) return null; |
| 97 |
|
|
| 98 |
|
$resource = new Item($data, new Transformer); |
| 99 |
|
$fractal = new FractalManager(); |
| 100 |
|
$data = $fractal->createData($resource)->toArray(); |
| 101 |
|
|
| 102 |
|
return $data['data']; |
| 103 |
|
|
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
public function byPid(Process $daemon, $pid) { |
| 107 |
|
|
|
@@ 106-116 (lines=11) @@
|
| 103 |
|
|
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
public function byPid(Process $daemon, $pid) { |
| 107 |
|
|
| 108 |
|
$data = self::getManager($daemon)->get(['pid' => $pid]); |
| 109 |
|
|
| 110 |
|
$resource = new Collection($data, new Transformer); |
| 111 |
|
$fractal = new FractalManager(); |
| 112 |
|
$data = $fractal->createData($resource)->toArray(); |
| 113 |
|
|
| 114 |
|
return $data['data']; |
| 115 |
|
|
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
protected static function getManager(Process $daemon) { |
| 119 |
|
|