. */ declare(strict_types=1); namespace FireflyIII\Transformers; use FireflyIII\Models\RuleGroup; /** * Class RuleGroupTransformer */ class RuleGroupTransformer extends AbstractTransformer { /** * Transform the rule group */ public function transform(RuleGroup $ruleGroup): array { return [ 'id' => $ruleGroup->id, 'created_at' => $ruleGroup->created_at->toAtomString(), 'updated_at' => $ruleGroup->updated_at->toAtomString(), 'title' => $ruleGroup->title, 'description' => $ruleGroup->description, 'order' => $ruleGroup->order, 'active' => $ruleGroup->active, 'links' => [ [ 'rel' => 'self', 'uri' => '/rule_groups/'.$ruleGroup->id, ], ], ]; } }