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

🐛 FK id Column case mismatch #388

Open
1 task done
gam6itko opened this issue Dec 27, 2022 · 0 comments
Open
1 task done

🐛 FK id Column case mismatch #388

gam6itko opened this issue Dec 27, 2022 · 0 comments
Assignees
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug

Comments

@gam6itko
Copy link
Contributor

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

We have classes below

class AClass {

   #[Cycle\Column(type: 'integer')]
   private int $userId;
}
class BClass {
    #[Cycle\Relation\BelongsTo(target: User::class)]
    private Exchanger $user;
}
class User {
     #[Cycle\Column(type: 'primary')]
     private ?int $id = null;
   
    // properties here
}

When I make requests like this. In the $aList the members have a userId property, and in the $bList there is a user_id property.

 $aList = $this->getOrm()->getRepository(AClass::class)
            ->select()
            ->fetchData();

// $alist = [ ['userId' => 1] ]
            
 $bList = $this->getOrm()->getRepository(BClass::class)
            ->select()
            ->fetchData();
// $bList = [ ['user_id' => 1, 'user' => ['id' => 1, 'foo' => 'bar']] ]

Is it possible to do something with the #[Cycle\Column(type: 'integer')] to fetch columns in different cases in queries?

Version

PHP 8.1
cycle/orm  2.2.1
@gam6itko gam6itko added status:to be verified Needs to be reproduced and validated. type:bug Bug labels Dec 27, 2022
@roxblnfk roxblnfk added this to Cycle Dec 28, 2022
@roxblnfk roxblnfk moved this to Todo in Cycle Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug
Projects
Status: Todo
Development

No branches or pull requests

2 participants