. */ declare(strict_types=1); namespace FireflyIII\Transformers\V2; use FireflyIII\Models\Preference; use Illuminate\Support\Collection; /** * Class PreferenceTransformer */ class PreferenceTransformer extends AbstractTransformer { /** * @inheritDoc */ public function collectMetaData(Collection $objects): void { // TODO: Implement collectMetaData() method. } /** * Transform the preference * * @param Preference $preference * * @return array */ public function transform(Preference $preference): array { return [ 'id' => (int)$preference->id, 'created_at' => $preference->created_at->toAtomString(), 'updated_at' => $preference->updated_at->toAtomString(), 'name' => $preference->name, 'data' => $preference->data, ]; } }