PHPackages                             level51/silverstripe-data-object-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. level51/silverstripe-data-object-actions

ActiveSilverstripe-vendormodule

level51/silverstripe-data-object-actions
========================================

Custom GridField detail form actions for DataObjects

2.0.1(4mo ago)01.5kMITPHPPHP &gt;=8.0

Since Apr 28Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/Level51/silverstripe-data-object-actions)[ Packagist](https://packagist.org/packages/level51/silverstripe-data-object-actions)[ RSS](/packages/level51-silverstripe-data-object-actions/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (1)Versions (16)Used By (0)

SilverStripe DataObject Actions
===============================

[](#silverstripe-dataobject-actions)

Module for Silverstripe 6 allowing to add custom actions for DataObjects to the GridFieldDetailForm. See `0.X` releases for Silverstripe 4 support and `1.X` releases for Silverstripe 5 support.

Installation
------------

[](#installation)

`composer require level51/silverstripe-data-object-actions`

Usage
-----

[](#usage)

```
namespace My\Awesome\Project;

use Level51\DataObjectActions\DataObjectActionProvider;
use Level51\DataObjectActions\DataObjectAction;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\DataObject;

// Implement DataObjectActionProvider interface on your DataObject
class MyDataObject extends DataObject implements DataObjectActionProvider {

  // Return a field list containing all custom actions, each one of type DataObjectAction or DataObjectLink
  public function getCustomActions()
  {
    return FieldList::create(
      [
        DataObjectAction::create('myCustomAction', 'My Custom Action')
          ->addExtraClass('btn-outline-primary font-icon-rocket')
          ->setUseButtonTag(true),
        DataObjectLink::create('externalLink', 'External Link', 'https://lvl51.de')
        	->addExtraClass('btn-outline-dark font-icon-external-link')
          ->setNewWindow(true)
      ]
    );
  }

  // Implement the handler method(s)
  public function myCustomAction($data, $form)
  {
    // Do stuff, e.g. set a property
    // Do NOT call $this->write(), this will be done automatically
    // use `setWriteBeforeAction` when creating the action if the record
    // should be written before the action is executed

    // throw a new \SilverStripe\Core\Validation\ValidationException in case something failed

    // Optionally return a success message
    return 'Success message';
  }

}
```

### Usage with DataExtensions

[](#usage-with-dataextensions)

You can update the custom actions of a parent class implementing the DataObjectActionProvider interface using the `updateCustomActions` extension hook.

```
public function updateCustomActions(FieldList $fields)
{
    $fields->push(
        DataObjectAction::create(...)
    );
}
```

To be able to add custom actions to an owner class which is out of your control (e.g. core Member class) you have to use the Level51\\DataObjectActions\\DataExtension class as base class of your extension. With that you are able to use the getCustomActions method as shown above.

Action Options
--------------

[](#action-options)

- use `setIsAlwaysEnabled` to always enable the action, even if the whole edit form is read-only
- use `setWriteBeforeAction` if the record should be written before the action is executed

Requirements
------------

[](#requirements)

- SilverStripe ^6
- PHP &gt;= 8.0

Maintainer
----------

[](#maintainer)

- Level51

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance76

Regular maintenance activity

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~189 days

Recently: every ~153 days

Total

12

Last Release

131d ago

Major Versions

0.4.3 → 1.0.02024-05-06

0.4.4 → 1.0.12025-12-01

1.0.1 → 2.0.02026-01-08

PHP version history (2 changes)0.1.0PHP &gt;=7.0

1.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/441f0e8f95c17048417a33f37e35d5ffdd4c07902cbedaf7f5786f4b7c454284?d=identicon)[JZubero](/maintainers/JZubero)

---

Top Contributors

[![dkliemsch](https://avatars.githubusercontent.com/u/13777159?v=4)](https://github.com/dkliemsch "dkliemsch (34 commits)")

---

Tags

silverstripe

### Embed Badge

![Health badge](/badges/level51-silverstripe-data-object-actions/health.svg)

```
[![Health](https://phpackages.com/badges/level51-silverstripe-data-object-actions/health.svg)](https://phpackages.com/packages/level51-silverstripe-data-object-actions)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5163.4M1.3k](/packages/silverstripe-cms)[silverstripe/admin

SilverStripe admin interface

262.6M325](/packages/silverstripe-admin)[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)[silverleague/ideannotator

Generate PHP DocBlock annotations for DataObject and DataExtension databasefields and relation methods

4768.0k43](/packages/silverleague-ideannotator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
