sowork-php-framework Wiki
Brought to you by:
diyism
Yet another PHP framework, simpler than ORM, chain syntax etc.
SoWork PDO:
$pdo->safe_query(get_defined_vars(), "insert into z_test (name, value) values ({&name}, {#value})" ); $pdo->safe_query(get_defined_vars(), "safe_replace into z_test (name, value) values ({&name}, {#value})" ); $pdo->step_query(get_defined_vars(), "select sql_calc_found_rows *, (step_select Site from site_Config where ID=sem_ClassifyAccount.SiteID) (step_select ID,AccountName from sem_VAccount where ClassifyAccountID=sem_ClassifyAccount.ID) from sem_ClassifyAccount {$where} " );
SoWork PDO even could do more than 2 steps automatic queries(Notice "sem_ClassifyAdgroup.sem_ClassifyAccount_rows.0.SiteID" and the order):
$pdo->step_query(get_defined_vars(), "select sql_calc_found_rows *, (step_select ID,SiteID,AccountName from sem_ClassifyAccount where ID=sem_ClassifyAdgroup.ClassifyAccountID), (step_select Site from site_Config where ID=sem_ClassifyAdgroup.sem_ClassifyAccount_rows.0.SiteID) from sem_ClassifyAdgroup {$where} " );
Chain syntax:
define('echo', 'my_echo'); function my_echo($obj) {echo $obj; return $obj; } S('abcd')->substr(this, 2, 2)->strlen(this)->echo(this); S()->substr('abcd', 1, 3)->strlen(this)->echo(this);