Hi all,
I don’t know what I’m miising but I couldn’t use getOne() with my custom DB
Here are the relevant lines ofmy schema:
<object class="Socios" table="socios" extends="xPDOSimpleObject">
<field key="carsocio" dbtype="int" precision="2" phptype="integer" null="false" />
<aggregate alias="miCarSocio" class="Carsocio" local="carsocio" foreign="id" cardinality="one" owner="foreign" />
</object>
<object class="Carsocio" table="carsocio" extends="xPDOSimpleObject">
<field key="nombre" dbtype="char" precision="15" phptype="string" null="false" />
<composite alias="misSocios" class="Socios" local="id" foreign="carsocio" cardinality="many" owner="local" />
</object>
Here’s t he php:
$carsocio=$socio->getOne(‘miCarsocio’)->get(‘nombre’);
But it produces this error:
[2020-03-31 23:26:48] (ERROR @ /home/ach/public_html/gpatax/core/xpdo/xpdo.class.php : 1826) No foreign key definition for parentClass: Socios using relation alias: miCarsocio
Any idea what could I be missing?
Thanks