Solar_Sql_Model_Params_Fetch::join()

public Solar_Sql_Model_Params_Fetch Solar_Sql_Model_Params_Fetch::join ( array $spec )

Adds a single arbitrary JOIN to the fetch.

Parameters

  • (array) $spec: An array with keys type, name, cond, and cols.

Returns

  • (Solar_Sql_Model_Params_Fetch)

Description

Adds a single arbitrary JOIN to the fetch.

For example, to left join to a table 'bar' on 'bar.id' and select columns dib, zim, and gir from it:

<?php
$fetch->join(array(
    'type' => 'left',
    'name' => 'bar',
    'cond' => 'bar.id = foo.id',
    'cols' => array('dib', 'zim', 'gir'),
));

The type, if left null, defaults to an inner join; cols, if left null, will select no columns.

See Also



Local