Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables flexible JOIN. #32

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -7,6 +7,7 @@ class NotORM_Result extends NotORM_Abstract implements Iterator, ArrayAccess, Co
protected $select = array(), $conditions = array(), $where = array(), $parameters = array(), $order = array(), $limit = null, $offset = null, $group = "", $having = "", $lock = null;
protected $union = array(), $unionOrder = array(), $unionLimit = null, $unionOffset = null;
protected $data, $referencing = array(), $aggregation = array(), $accessed, $access, $keys = array();
protected $customizedJoins = array();

/** Create table result
* @param string
@@ -104,9 +105,26 @@ protected function createJoins($val) {
}
}
}

if(count($this->customizedJoins) > 0) {
foreach($this->customizedJoins as $name=>$query) {
$return[$name] = " ".$query;
}
}

return $return;
}

/** Flexible JOIN
* @param string table to JOIN
* @param string JOIN part
* @return string SQL query
**/
function join($tableName, $joinQuery) {
$this->customizedJoins[$tableName] = $joinQuery;
return $this;
}

/** Get SQL query
* @return string
*/
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.