Skip to content

Can one object belongsTo more than one user ? #42

@jozefrebjak

Description

@jozefrebjak

I have a table orders.

There is two columns disponent_id & salesman_id.

Both have foreign key to the users table id. If I don't overwrite a scheme, then it's used last one so only user paired to the salesman_id.

So I tried to overwrite schema like in #41. Now my relation to the users table looks like:

                [users] => Tatter\Schemas\Structures\Relation Object
                (
                    [table] => users
                    [type] => belongsTo
                    [singleton] => 
                    [pivots] => Array
                        (
                            [0] => Array
                                (
                                    [0] => orders
                                    [1] => salesman_id
                                    [2] => users
                                    [3] => id
                                )

                            [1] => Array
                                (
                                    [0] => orders
                                    [1] => disponent_id
                                    [2] => users
                                    [3] => id
                                )

                        )

                )

I think this is a bad design, but I need to pair two users from different groups because of internal settlement.

Thanks.

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