Skip to content

Instantly share code, notes, and snippets.

@nicohofmann
Created September 12, 2012 20:10
Show Gist options
  • Save nicohofmann/3709538 to your computer and use it in GitHub Desktop.
Save nicohofmann/3709538 to your computer and use it in GitHub Desktop.
class City extends AbstractTableGateway
public function searchByName ($str)
{
$like = function (\Zend\Db\Sql\Where $where) use ($str)
{
$where->like('name', $str . '%');
};
$resultSet = $this->select(function (\Zend\Db\Sql\Select $select) use ($like)
{
$select->where(
$like
);
}
);
return $resultSet;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment