protected static $_belongs_to = array(
'adresse' => array(
'key_from' => 'adresse',
'model_to' => 'Model_Adresse',
'key_to' => 'idadresse',
'cascade_save' => true,
'cascade_delete' => false,
),
'typecontact' => array(
'key_from' => 'typecontact',
'model_to' => 'Model_Type_contact',
'key_to' => 'idtypecontact',
'cascade_save' => true,
'cascade_delete' => false,
)
);
protected static $_properties = array(
'idcontact',
'tcivilite',
'tnom',
'tprenom',
'participant',
'stage',
);
protected static $_has_many = array(
'contact' => array(
'key_from' => 'idtypecontact',
'model_to' => 'Model_Contact',
'key_to' => 'typecontact',
'cascade_save' => false,
'cascade_delete' => false,
)
);
protected static $_properties = array(
'idtypecontact',
'ttypecontact',
);
$contact->save();
Fuel\Core\Database_Exception [ Error ]: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`gesta4`.`contact`, CONSTRAINT `FK_4C62E638593B531F` FOREIGN KEY (`typeContact`) REFERENCES `type_contact` (`idTypeContact`)) with query: "INSERT INTO `contact` (`tcivilite`, `tnom`, `tprenom`, `participant`, `stage`) VALUES ('Madame', 'Gglerj', 'Fdsfoh', '35', null)"
It looks like you're new here. If you want to get involved, click one of these buttons!