anthonygauthier / MySimpleORM

Simple, lightweight and effective PHP ORM using MySQLi.
MIT License
7 stars 4 forks source link

simplify where part or use a string based syntax? #10

Closed pwFoo closed 4 years ago

pwFoo commented 4 years ago

Where with more than one condition is much to write.

$wheres = array(
    "column" => "IDCompanies",
    "condition" => "=",
    "value" => 1 //keep in mind you could use a sub-query here
);

Would a simpler syntax be possible?

Or as another way to do it... string based "selector"? Something like:

$Users = new Users();
$users->getArray("IDCompanies=1,anotherField>10,...");

I'm really like the Processwire Selectors which works that way ans also support subfield selectors too https://processwire.com/docs/selectors/#components

anthonygauthier commented 4 years ago

Yeah I could work on implementing a logic to support both ways.