| 1 | <?php |
||
| 17 | abstract class PrimaryJsonDataNode extends JsonDataNode |
||
| 18 | { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * wp script handle for the app that requires the JSON data |
||
| 22 | * |
||
| 23 | * @var string $target_script |
||
| 24 | */ |
||
| 25 | private $target_script; |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * sets the WP script handle that this data node is providing data for. |
||
| 30 | * The JSON data will written to the DOM inline prior to the targeted script handle |
||
| 31 | * |
||
| 32 | * @param string $target_script |
||
| 33 | * @throws DomainException |
||
| 34 | */ |
||
| 35 | public function setTargetScript($target_script) |
||
| 42 | |||
| 43 | |||
| 44 | /** |
||
| 45 | * the WP script handle that this data node is providing data for |
||
| 46 | * |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public function targetScript() |
||
| 53 | } |
||
| 54 |