App\services\Database::where PHP Method

where() private method

Generate where statement
private where ( array $condition ) : string
$condition array e.g. array('where'=>'username="shit"', 'limit'=>10, 'order'=>'uid')
return string
    private function where($condition)
    {
        $statement = "";
        if (isset($condition['where']) && $condition['where'] != "") {
            $statement .= ' WHERE ' . $condition['where'];
        }
        if (isset($condition['order'])) {
            $statement .= ' ORDER BY `' . $condition['order'] . '`';
        }
        if (isset($condition['limit'])) {
            $statement .= ' LIMIT ' . $condition['limit'];
        }
        return $statement;
    }