HandleAction.php
1 week ago
HandleActionLabels.php
1 week ago
HandleActionManifest.php
1 week ago
HandleActionSend.php
1 week ago
HandleActionStrategy.php
1 week ago
HandleActionStrategyInterface.php
1 week ago
HandleAction.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class HandleAction |
| 4 | */ |
| 5 | |
| 6 | namespace WPDesk\FS\Shipment\BulkAction; |
| 7 | |
| 8 | /** |
| 9 | * . |
| 10 | */ |
| 11 | class HandleAction { |
| 12 | |
| 13 | /** |
| 14 | * @var HandleActionStrategyInterface |
| 15 | */ |
| 16 | private $strategy; |
| 17 | |
| 18 | /** |
| 19 | * @param HandleActionStrategyInterface $strategy |
| 20 | * |
| 21 | * @return $this |
| 22 | */ |
| 23 | public function set_strategy( HandleActionStrategyInterface $strategy ): self { |
| 24 | $this->strategy = $strategy; |
| 25 | |
| 26 | return $this; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * @param string $redirect_to . |
| 31 | * @param array $post_ids . |
| 32 | * |
| 33 | * @return string |
| 34 | */ |
| 35 | public function handle( string $redirect_to, array $post_ids ): string { |
| 36 | return $this->strategy->handle( $redirect_to, $post_ids ); |
| 37 | } |
| 38 | } |
| 39 |