Shroder/nodemesh — Issue #1: Calls and Columns
Author: Shroder
Created: 2011-11-30 03:59:39+00:00
State: open

Calls are objects that contain parts of a request. Calls are grouped together within a CallChain object, and together they represent an API call.

For example, the following would have a CallChain object with a Call for the first line, and then two more Calls for the second line.

$node = new Node("Foo");
$node->node("eq:foo:bar")->node;

Calls are not just nodes. At the moment a jump can also be a call, but that may be depreciated depending on whether or not my changes are adopted in the master.

Now to the issue. A Call consists of several attributes. It acts as a middle point between a database abstraction class and a syntax handler for the API. The columns attribute is counterintuitive, as it is actually referring to plugins that may be passed through the node/cluster constructor rather then an actual column. In order to get the real columns from a call, columns needs to be branched twice. There are also some other areas with redundant naming that could probably be cleaned up.

$call->columns[0]->getColumns()

````PHP
Call Object
(
[columns] => Array
(
[0] => Expression Object
(
[_columns:Expression:private] => Array
(
[0] => Column Object
(
[_table:protected] =>
[_column:protected] => pk
)

[1] => Column Object
(
[_table:protected] =>
[_column:protected] => foo
)

[2] => Column Object
(
[_table:protected] =>
[_column:protected] => bar
)

)

[_expression:Expression:private] => %s, %s, %s
[_alias:Expression:private] =>
)

)

[table] =>
[where] => Array
(
[0] => Array
(
[andor] => AND
[column] => Expression Object
(
[_columns:Expression:private] => Array
(
[0] => Column Object
(
[_table:protected] =>
[_column:protected] => foo
)

)

[_expression:Expression:private] => %s
[_alias:Expression:private] =>
)

[value] => 1324
[query] => %col = %val
)

)

[group] => Array
(
)

[order] => Array
(
)

[start] => 0
[limit] =>
[context] =>
[debug] =>
[flag] =>
[jump] =>
[not_linked] =>
[wrap] =>
[optional] =>
[_parent] =>
[_calls] => Array
(
)

)
````