Closed keevitaja closed 7 years ago
I think it makes more sense to concatenate in the entity object.
public function fullname()
{
return "{$this->firstname} {$this->lastname}";
}
However if preferred you can use ->query(...)
to manually create a query with concatenation. Something like.
$foo = $mapper->query("SELECT CONCAT(firstname, ' ', lastname) AS fullname FROM foo WHERE id = 1");
Not sure how this would map to the entity though.
Ok, tnx!
Hello!
I have columns firstname and name. I need to do a where statement where firstname and name are concatenated...
select concat(firstaname, ' ', name) as fullname where fullname ....
Is it possible to do this?