Announcement

Collapse
No announcement yet.

OneToOne relationShip and number field type

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OneToOne relationShip and number field type

    Hello Teams,
    very strange, i have try many and many ..and Number (auto-increment) and don't understand :
    entity : AA have oneToMany BB
    entity : BB have oneToOne to CC, to DD, to EE

    on a service, i create the entity AA ... number type field autoIncrement are not set !

    PHP Code:
    $aa->set([ 'name' => $name ]);
     
    $entityManager->saveEntity($aa); 
    aaNumberField is empty !?

    in the same service : i create bb
    PHP Code:
    $bb->set([
    'name' => $patient->get('name') .' ' .$contact->get('name')  ]);
     
    $entityManager->saveEntity($bb); 
    bbNumberField is set !

    i relate bb to aa
    PHP Code:
    $entityManager->getRepository('AA')->relate($aa'xyz'$bb); 
    it's work .. oneToMany

    and i try to relate some oneToOne on bb entity and
    PHP Code:
    $entityManager->getRepository('bb')->relate($bb'xyzw'$cc); 
    and only one bb is related ! (i think unique Id )

    i have not find the right way to relate oneToOne and why aaNumberField is not set and bbNumberField is set :s
    i use pdo to update in hard way..

    For me, it's relate bb only one time to other entity.... but it's oneToOne.. then each bb have to be related.

    I have no formula, no hook in these two entity..

    Any helps

    Regards
    Last edited by item; 02-16-2020, 10:33 PM.
Working...
X