The Last Relationship, I Think

There is one last statement clause that need to determine if I can fit the pieces into my “relationship” idea. That clause is the table reference. Each table reference will be a single relationship. Of course, a simple table reference will only be a name, no value or operator needed. Any JOIN table will need a name and a value, then maybe use the operator to hold the JOIN type. The name will be the table name, the value can be used to hold the ON clause. The ON clause itself being a collection of relationships. So each table reference will not be a name/value pair, per se, but a relationship none the less.

I have been pondering the user interface in the back of my mind during these brainstorms about “relationships”. I actually think a jQuery type chaining system would be easiest to use. Imagine this:

$objTable = tableReference::newTable('table1')->setAS('t1')->setJoin('INNER')->setON($objONclause);

I need to use a static construction function because using a standard “new Object()” method cannot be further manipulated. The static constructor will internally can its own standard __construct() method. But before I get too deep into that, I need to breakdown all these relationships and try to find a common structure. My initial thought is to have an abstract “relationship” class that will be extended into each of the different types: select expression, table reference, set expression, where condition, and join on condition.


One Comment

  1. […] quite complex and cumbersome. Hopes are to use a chaining system, as briefly described in “The Last Relationship, I Think“, to reduce code and simplify the […]

Leave a Reply