| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function run($request) |
||
| 30 | { |
||
| 31 | $root = $request->getVar('parent'); |
||
| 32 | if (!$root) { |
||
| 33 | throw new Exception("Sorry, you must provide a parent node to publish from"); |
||
| 34 | } |
||
| 35 | |||
| 36 | $item = DataObject::get_by_id('Page', $root); |
||
| 37 | |||
| 38 | if ($item && $item->exists()) { |
||
| 39 | $job = new PublishItemsJob($root); |
||
| 40 | singleton('Symbiote\\QueuedJobs\\Services\\QueuedJobService')->queueJob($job); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 |