atk4/atk4 — pull request #537 by DarkSide666 (2014-05-19 17:13:04+00:00)
Title: CRUD->addRef, custom model for sub-View

Now CRUD->addRef can use custom models for sub-View.
That's especially handy when you need deep references, for example, in case of n:m relationship.

Imagine models: `Client --< DocumentRelation >-- Document`.
I have CRUD of clients and I want to add expander for CRUD of Document (not DocumentRelation).
So now I can do simply like this:

```
$sub = $client->addRef('Document', array(
'view_model' => function($model) {
$d = $model->add('Model_Document');
$d->addCondition($d->id_field, 'in', $model->ref('DocumentRelation')->fieldQuery('document_id'));
return $d;
},
));
```