How do you use expressions in the ON clause of a JOIN with a TableGateway? In 
the following code, the "5" is being
quoted with brackets by the Sqlsrv adapter.

class ProductsTable extends AbstractTableGateway
{
    protected $table = 'Products';
}


public function fetchProducts() {
    $products = new ProductsTable();
    $newProducts = $products->select(
        function (Select $select) {
            $select->join(
                array('i' => 'Items'),
                'i.ProductID = Products.ItemID AND Products.ItemID < 5',
                $select::SQL_STAR,
                $select::JOIN_LEFT
            );

            $select->where->isNull('i.ItemID');
            $select->where->greaterThan('Products.Qty', 0);
        });
    return $products;
}

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to