Skip to content

Commit

Permalink
Add suffix to the methods so they don't conflict (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berat-Dzhevdetov authored Sep 16, 2024
1 parent 9e30f91 commit 6af46d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion krait/src/Tables/BaseTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
abstract class BaseTable
{
private const METHOD_SUFFIX = 'KraitAttribute';

/**
* The internal table columns.
*
Expand Down Expand Up @@ -201,7 +203,7 @@ public function processRecord(Model|array $resource, mixed $placeholder = null):

$row = [];
foreach ($this->getColumns() as $column) {
$columnMethod = sprintf('get%s', Str::ucfirst($column->name));
$columnMethod = sprintf('get%s%s', Str::ucfirst($column->name), self::METHOD_SUFFIX);

if ($column->hasProcessingCallback()) {
$row[$column->name] = $column->process($resource) ?? $placeholder;
Expand Down

0 comments on commit 6af46d1

Please sign in to comment.