Closed lordmemed closed 7 years ago
Hi,
Just copy the source. Then Create your DatabaseQuery class Creates the connection and stores in your DatabaseQuery in a field Set a Facade for your request of the query builder. Then create a query class or how you would like to call. And just create a method with the query in it.
So in pseudo
class DatabaseQuery {
public function _construct()
{
//Create a PDO instance and put in the instance of the field
//Create your alias like
class_alias('AliasFacade', "YourAlias");
AliasFacade::setQueryBuilderInstance(new QueryBuilderHandler($this));
}
}
class DataQueryClass
{
public function GetUserById($id)
{
return YourAlias::table("table_name_users")->find((int)$id, "id");
}
}
hai, @eL-Prova. thanks for your answer.
how about abstraction and extends from it? is there another example/pseudo-example maybe?
Why you need an abstraction? The QueryBuilderHandler should be on his own. SOLID ;-) (Single responsibility) I think you need to try it with this and when needed create new ticket so your question will be more focused on your problem.
@eL-Prova $dbconf is config array for pixie connection.
oh, i has solved that problem. thanks.
just more question.
thank you very much.
sincerely, @lordmemed
Sent from my Polymer 2 using FastHub
@lordmemed this is not a place for homework discussion. Please continue elsewhere.
You're egoist.