Skip to content

Enhancement: table views in related models #424

@Oggo87

Description

@Oggo87

Right now, when relating models, there's no way of using a specific table view for the related model.
It would be a nice feature to be able to do something as the following:

$query = Glazes\Model_Colour::query()
	->related('formulas')
	->use_view('formulas.glaze_formulas_table_view');

Or even to define a default view for the relation:

protected static $_has_many = array(
		'formulas' => array(
			'key_from'       => 'id',
			'model_to'       => 'Glazes\Model_Formula',
			'key_to'         => 'colour_id',
			'view'         => 'glaze_formulas_table_view',
			'cascade_save'   => false,
			'cascade_delete' => false,
			'conditions'	 => array(
					'order_by' => array('date' => 'desc')
			)
	)
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions