Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

selecting without onlyFields causes nested model to use (*). #4

Open
romaninsh opened this issue Mar 15, 2017 · 1 comment
Open

selecting without onlyFields causes nested model to use (*). #4

romaninsh opened this issue Mar 15, 2017 · 1 comment

Comments

@romaninsh
Copy link
Member

// model - purchase invoices
$mi = $m->ref('InvPurchaseLines');
$mi->addDocumentFields();
$mi->onlyFields(['dochead_id','date','contractor_from','contact','ref_no','exchanged_total_net','nominal_id','nominal']);

            $m = new \smbo\UnionModel($mi->persistence);
            $m->addNestedModel($mi, [
                'dochead_id'    => '[dochead_id]',
                'date'          => '[date]',
                'contact_id'    => '[contractor_from]',
                'contact'       => '[contact]',
                'inv_no'        => '[ref_no]',
                'amount'        => '[exchanged_total_net]',
                'nominal_id'    => '[nominal_id]',
                'nominal'       => '[nominal]',
            ]);

echo $m->action('select')->getDebugQuery(true);

@DarkSide666
Copy link
Member

Exception is thrown when I try to $m->export(); or any other method which uses model->getIterator()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants