GridAction.php 648 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * @var string
  16. */
  17. public $selectorPrefix = '.grid-action-';
  18. /**
  19. * @param Grid $grid
  20. *
  21. * @return $this
  22. */
  23. public function setGrid(Grid $grid)
  24. {
  25. $this->parent = $grid;
  26. return $this;
  27. }
  28. /**
  29. * Get url path of current resource.
  30. *
  31. * @return string
  32. */
  33. public function resource()
  34. {
  35. return $this->parent->resource();
  36. }
  37. }