1
0
Fork 0
mirror of https://github.com/archtechx/virtualcolumn.git synced 2025-12-12 17:24:03 +00:00

add docblock

This commit is contained in:
Samuel Štancl 2022-10-21 14:08:35 +02:00 committed by GitHub
parent 73d7918170
commit ac0dccc6e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,9 +140,14 @@ trait VirtualColumn
];
}
/**
* Get a column name for an attribute that can be used in SQL queries.
*
* (`foo` or `data->foo` depending on whether `foo` is in custom columns)
*/
public function getColumnForQuery(string $column): string
{
if (in_array($column, static::getCustomColumns())) {
if (in_array($column, static::getCustomColumns(), true)) {
return $column;
}