I want to retrive a rowset based on a many-to-many relationsship. Now I
do like below, but that give me in a not ordered way. And I want to do
the sorting etc based on this. I would also like to do a "LIMIT 10,20"
to just retrieve a set of this rowset. Either I just build my query from
scratch, but I am interested to see if possible via the table
framework.  

$o_division = $o_divisions->current();
$o_products = $o_division->findManyToManyRowset('Product',
'ProductDivision');


class Product extends Zend_Db_Table_Abstract {
        protected $_name = 'product';
        protected $_sequence = true;
        protected $_dependentTables = array("ProductIndustry",
"ProductDivision", "ProductMaterial");
}


class ProductDivision extends Zend_Db_Table_Abstract {
        protected $_name = 'product_division';
        protected $_sequence = true;
    protected $_referenceMap    = array(
        'Division' => array(
            'columns'           => 'division_id',
            'refTableClass'     => 'Division',
            'refColumns'        => 'division_id',
                'onDelete'                      => self::CASCADE
        ),
        'Product' => array(
            'columns'           => 'product_id',
            'refTableClass'     => 'Product',
            'refColumns'        => 'product_id',
                'onDelete'                      => self::CASCADE
        )
    );          
}


class Division extends Zend_Db_Table_Abstract {
        protected $_name = 'division';
        protected $_sequence = true;
        protected $_dependentTables = array("ProductDivision");
}


Reply via email to