Skip to content

Commit d373a1c

Browse files
GianlucaGianluca
authored andcommitted
Define qualifyColumns method
1 parent 1316c26 commit d373a1c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,20 @@ public function qualifyColumn($column)
434434
return $this->getTable().'.'.$column;
435435
}
436436

437+
/**
438+
* Qualify the column's lists name by the model's table.
439+
*
440+
* @param array|mixed $columns
441+
* @return array
442+
*/
443+
public function qualifyColumns(...$columns) {
444+
$qualifiedArray = [];
445+
foreach($columns as $column) {
446+
$qualifiedArray[] = $this->qualifyColumn($column);
447+
}
448+
return $qualifiedArray;
449+
}
450+
437451
/**
438452
* Create a new instance of the given model.
439453
*

0 commit comments

Comments
 (0)