GridAction.php 561 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Dcat\Admin\Grid;
  3. use Dcat\Admin\Actions\Action;
  4. use Dcat\Admin\Grid;
  5. /**
  6. * Class GridAction.
  7. */
  8. abstract class GridAction extends Action
  9. {
  10. /**
  11. * @var Grid
  12. */
  13. protected $parent;
  14. /**
  15. * @param Grid $grid
  16. * @return $this
  17. */
  18. public function setGrid(Grid $grid)
  19. {
  20. $this->parent = $grid;
  21. return $this;
  22. }
  23. /**
  24. * Get url path of current resource.
  25. *
  26. * @return string
  27. */
  28. public function resource()
  29. {
  30. return $this->parent->resource();
  31. }
  32. }