Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YML virtual_properties no group exlcusion #656

Closed
ranqx-api opened this issue Oct 13, 2016 · 1 comment
Closed

YML virtual_properties no group exlcusion #656

ranqx-api opened this issue Oct 13, 2016 · 1 comment

Comments

@ranqx-api
Copy link

Group property defined under virtual_properties don't seem to exclude the virtual properties when the group isn't supplied.

YML

My\Bundle\Entity\Finance:
    exclusion_policy: ALL
    access_type: public_method
    xml_root_name: finance
    properties:
        id:
            groups: [finance, min]
            access_type: property
        currency:
            groups: [finance]
        period:
            groups: [finance]
            serialized_name: year_ending
        staffNumber:
            groups: [finance]
    virtual_properties:
        getRawDataParsed:
            groups: [finance_account]
            serialized_name: finance_accounts

Supplied context

$context->addGroups(['finance', BaseController::CONTEXT_GROUP_MIN]);

In the YML, the parent group is "finance", and the virtual property group is "finance_account". (CONTEXT_GROUP_MIN is an always-on "min" group to display IDs only)

Expected behavior

The exclusion of the virtual property data, unless both "finance" and "finance_account" groups are supplied to the context.

<?xml version="1.0" encoding="UTF-8"?>
<result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <entry>
        <id>186</id>
        <currency>
            <![CDATA[NZD]]>
        </currency>
        <staff_number>3</staff_number>
        <year_ending>
            <![CDATA[2016-03-01T00:00:00+13:00]]>
        </year_ending>
    </entry>
</result>

Actual

Virtual property is output

<?xml version="1.0" encoding="UTF-8"?>
<result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <entry>
        <id>186</id>
        <currency>
            <![CDATA[NZD]]>
        </currency>
        <staff_number>3</staff_number>
        <finance_accounts>
            <entry>
                <id xsi:nil="true"/>
                <code>
                    <![CDATA[ASS]]>
                </code>
                <title>
                    <![CDATA[Bank #1]]>
                </title>
                <price>56000</price>
                <type>
                    <![CDATA[A-CB]]>
                </type>
                <original_type>
                    <![CDATA[A-CB]]>
                </original_type>
            </entry>
            <entry>
                <id xsi:nil="true"/>
                <code>
                    <![CDATA[ASS]]>
                </code>
                <title>
                    <![CDATA[Bank #2]]>
                </title>
                <price>-13000</price>
                <type>
                    <![CDATA[L-CB]]>
                </type>
                <original_type>
                    <![CDATA[L-CB]]>
                </original_type>
            </entry>
        </finance_accounts>
        <year_ending>
            <![CDATA[2016-03-01T00:00:00+13:00]]>
        </year_ending>
    </entry>
</result>
@ranqx-api
Copy link
Author

User error: user is a muppet

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

No branches or pull requests

1 participant