<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/libs/Dialect/Dialect_Operations.php</filename>
    </added>
    <added>
      <filename>example_application/model/webinsys/Users.php</filename>
    </added>
    <added>
      <filename>example_application/model/webinsys/_mapping/Users.xml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <filename>.buildpath</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,9 @@
 &lt;?php
 /**
- * All phpBurn classes should extend this
+ * All phpBurn classes should extend thi
+ * 
+ * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+ * @version 0.37
  */
 abstract class PhpBURN_Core implements IPhpBurn {
 	/* The structure of the constants follow the concept
@@ -26,19 +29,19 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	const QUERY_MULTI_INSERT			= 100006;
 	
 	//Internal objects
-	protected $_connObj						= null;
-	public  $_mapObj							= null;
-	protected $_dialectObj					= null;
+	public $_connObj							= null;
+	public $_mapObj							= null;
+	public $_dialectObj							= null;
+	
+	//Fields mapping
+	public $_fields								= array();
 	
 	//Persistent methods storage
 	public $_where								= array();
-	protected $_orderBy						= null;
-	protected $_limit							= null;
-		//join storage
-		protected $_join							= array();
-		protected $_joinLeft					= array();
-		protected $_joinRight					= array();
-		protected $_joinInner					= array();
+	public $_orderBy							= null;
+	public $_limit									= null;
+	public $_select								= array();
+	public $_join									= array();
 	
 	/**
 	 * This is an automatic configuration when a model inherit another PhpBURN Model
@@ -111,6 +114,9 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	 * 
 	 * The original idea is from Hugo Ferreira da Silva in the Lumine Base code we just take and re-design it to our needs.
 	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
+	 * 
 	 * @param Integer $type
 	 * @param Mixed $opt
 	 * @return String
@@ -144,8 +150,48 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	}
 	
 	/**
+	 * join Function inserts a JOIN clause in the get()/find() method and than returns the join result in a array into the object
+	 * Ex. $obj-&gt;join('users');
+	 * returns $obj-&gt;_users-&gt;name and $obj-&gt;_users-&gt;login (but only as object not a PhpBURN model if you want methods in user use _getLink())
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
+	 * 
+	 * @param String $tableName
+	 * @param String $fieldLeft
+	 * @param String $fieldRight
+	 * @param String $operator
+	 * @param String $joinType
+	 */
+	public function join($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=', $joinType = 'JOIN') {
+		$this-&gt;_join[$tableName]['fieldLeft'] = $fieldLeft;
+		$this-&gt;_join[$tableName]['fieldRight'] = $fieldRight;
+		$this-&gt;_join[$tableName]['operator'] = $operator;
+		$this-&gt;_join[$tableName]['type'] = $joinType;
+	}
+	
+	public function joinLeft($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=') {
+		$this-&gt;join($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=', $joinType = 'LEFT JOIN');
+	}
+	
+	public function joinRight($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=') {
+		$this-&gt;join($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=', $joinType = 'RIGHT JOIN');
+	}
+	
+	public function joinInner($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=') {
+		$this-&gt;join($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=', $joinType = 'INNER JOIN');
+	}
+	
+	public function joinOutter($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=') {
+		$this-&gt;join($tableName, $fieldLeft = null, $fieldRight = null, $operator = '=', $joinType = 'OUTTER JOIN');
+	}
+	
+	/**
 	 * Validate Field(s) value(s) based on mapping instructions and dialect rules
 	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
+	 * 
 	 * @param String $fieldName
 	 * @return Boolean
 	 */
@@ -162,18 +208,28 @@ abstract class PhpBURN_Core implements IPhpBurn {
 		
 		return true;
 	}
+	
+	public function where($conditions) {
+		array_push($this-&gt;_where, $conditions);
+	}
 		
 	/**
+	 * SuperWhere (swhere)
+	 * 
 	 * This method allow your model to add various WHERE conditions before your get, search or find call.
+	 * However it uses a new way of define your conditions and keep ALL compatibility when database change.
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
 	 * 
 	 * @param String $condition_start
 	 * @param String $stringOperator
 	 * @param String/Integer $conditon_end
 	 * @param Boolean $override
 	 */
-	public function where($condition_start, $stringOperator, $conditon_end, $condition = &quot;AND&quot;, $override = false) {
+	public function swhere($condition_start, $stringOperator, $conditon_end, $condition = &quot;AND&quot;, $override = false) {
 		
-		$this-&gt;_exceptionObj-&gt;log('teste');
+		//$this-&gt;_exceptionObj-&gt;log('teste');
 		
 		$conditions = array();
 		$conditions['start'] = $condition_start;
@@ -205,6 +261,10 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	/**
 	 * Searchs the native spoken language operator and converts into a programatic operator based on $this-&gt;operatorsTable .
 	 * FIXME Discover another ( and more inteligent ) solution for this case and also move the operatorsTable too.
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
+	 * 
 	 * @param String $operator
 	 * @return String
 	 */
@@ -222,6 +282,14 @@ abstract class PhpBURN_Core implements IPhpBurn {
 		return $operator;
 	}
 	
+	/**
+	 * fetch() moves the cursor to the next result into the dataset
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
+	 * 
+	 * @return PhpBURN_Core
+	 */
 	public function fetch() {
 		$result = $this-&gt;dialect-&gt;fetch();
 		if ($result) {
@@ -277,6 +345,9 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	
 	/**
 	 * It puts a WHERE clause when you want to get a link with specific caracteristics
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
 	 *
 	 * @param String $linkName
 	 * @param String $field
@@ -288,6 +359,9 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	
 	/**
 	 * It sets a limit or pagination in you link call
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
 	 *
 	 * @param String $linkName
 	 * @param Integer $start
@@ -299,6 +373,9 @@ abstract class PhpBURN_Core implements IPhpBurn {
 	
 	/**
 	 * It creates a order into your link list
+	 * 
+	 * @author Kl&#233;derson Bueno &lt;klederson@klederson.com&gt;
+	 * @version 0.1a
 	 *
 	 * @param String $linkName
 	 * @param String $field</diff>
      <filename>app/libs/Core.php</filename>
    </modified>
    <modified>
      <diff>@@ -38,8 +38,5 @@ class PhpBURN_Dialect
 		return &quot;PhpBURN_Dialect_$dialect&quot;;
 	}
 	
-	public function callStoredProcedure($name,$attributes = array() ) {
-		
-	}
 }
 ?&gt;
\ No newline at end of file</diff>
      <filename>app/libs/Dialect.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
 &lt;?php
+PhpBURN::load('Dialect.Dialect_Operations');
 PhpBURN::load(&quot;Dialect.IDialect&quot;);
 
-class PhpBURN_Dialect_MySQL implements IDialect {
+
+class PhpBURN_Dialect_MySQL extends PhpBURN_Dialect_Operations implements IDialect  {
 	
-	private $obj = null;
+	protected $obj = null;
 	private $connection = null;
 	private $resultSet;
 	private $dataSet;
@@ -20,8 +22,10 @@ class PhpBURN_Dialect_MySQL implements IDialect {
 	/* Common Persistent Methods */
 	
 	public function find($pk = null) {
-		$where = $this-&gt;checkSearchConditions();
+		//Start checking the model object
+		print $sql = $this-&gt;prepareSelect();
 		
+		//$this-&gt;execute($sql);
 		
 	}
 
@@ -101,21 +105,12 @@ class PhpBURN_Dialect_MySQL implements IDialect {
 	
 	/* Auxiliar Methods */
 	
-	private function checkSearchConditions() {
-		foreach($this-&gt;obj-&gt;_where as $index =&gt; $conditions) {
-			$sql .= $sql != null ? &quot; $conditions[condition] \r\n&quot; : &quot; \r\n WHERE \r\n&quot;;
-			
-			$sql .= '`' . $conditions['start'] . '` ' . $conditions['operator'] . ' &quot;' . $conditions['end'] . '&quot;';
-		}
+	protected function handleSelect() {
 		
-		return $sql;
 	}
 	
-	protected function _prepareSQL($forCount = false, $what = '*')
-	{
-		$sql = &quot;SELECT &quot;;
-				
-		return $sql;
+	public function callStoredProcedure($name,$attributes = array() ) {
+		
 	}
 
 	/* Navigational Methods */</diff>
      <filename>app/libs/Dialect/MySQL.php</filename>
    </modified>
    <modified>
      <filename>app/libs/Exception.php</filename>
    </modified>
    <modified>
      <filename>app/libs/Extras/Views/IViews.php</filename>
    </modified>
    <modified>
      <filename>app/libs/Extras/Views/Views.php</filename>
    </modified>
    <modified>
      <diff>@@ -302,7 +302,7 @@ class PhpBURN_Map implements IMap {
 	public function validateField($fieldName) {
 		$keyExist = array_key_exists($fieldName, $this-&gt;fields);
 		
-		if($keyExist == true || $this-&gt;fields[$fieldName]['isRelationship'] == false) {
+		if($keyExist == true &amp;&amp; $this-&gt;fields[$fieldName]['isRelationship'] == false) {
 			return $this-&gt;modelObj-&gt;_dialectObj-&gt;validateValue($this-&gt;fields[$fieldName]['#value'],$this-&gt;fields[$fieldName]['type'], $this-&gt;fields[$fieldName]['length']);
 		} else {
 			//TODO Send an Exception Message: &quot;[!This field doesn't exist or is a Relationship!]: &lt;strong&gt;&quot;. get_class($this-&gt;modelObj) .&quot;-&gt;$fieldName &lt;/strong&gt;&quot;</diff>
      <filename>app/libs/Mapping/Map.php</filename>
    </modified>
    <modified>
      <filename>app/libs/Message.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,17 @@
 &lt;?php
 require_once('config.php');
-require_once('phpBurn.php');
+require_once('app/phpBurn.php');
 
 $config = new PhpBURN_Configuration($thisConfig);
 
-PhpBURN::import('webinsys.Teste','webinsys.subpackage.Teste2');
+PhpBURN::import('webinsys.Users');
 
-$teste = new Teste();
+$teste = new Users();
 
-$teste-&gt;where('login','eq','teste 1');
+$teste-&gt;swhere('login','=','teste 1');
+
+$teste-&gt;join('albums');
+$teste-&gt;join('teste','users.id','teste.id_user');
 
 $teste-&gt;find();
 </diff>
      <filename>example_application/index.php</filename>
    </modified>
    <modified>
      <filename>test/AllTests.php</filename>
    </modified>
    <modified>
      <filename>test/ExceptionTest.php</filename>
    </modified>
    <modified>
      <filename>test/helper.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a9ab38d127d774317d323672041bde6b07f9f7fd</id>
    </parent>
  </parents>
  <author>
    <name>Klederson Bueno</name>
    <email>klederson@klederson.com</email>
  </author>
  <url>http://github.com/klederson/phpburn/commit/34e4641a69836c09c83e3a1a27cead12f28f0afc</url>
  <id>34e4641a69836c09c83e3a1a27cead12f28f0afc</id>
  <committed-date>2009-04-01T20:47:30-07:00</committed-date>
  <authored-date>2009-04-01T20:47:30-07:00</authored-date>
  <message>Now we gerenate SELECT queries with JOIN ( all types )</message>
  <tree>88eaa52405edb9945845af938ce791d902844348</tree>
  <committer>
    <name>Klederson Bueno</name>
    <email>klederson@klederson.com</email>
  </committer>
</commit>
