05-12-2020, 02:49 PM
Hi!
I have a table with two primary keys, but no foreign keys and the table update is showing an error depending on the configuration of "protected $primaryKey".
If I remove "protected $primaryKey" it displays an error message but updates {else} it displays an error message and does not update.
Is it valid or possible to inform both primary keys?
Model:
Pleas, any suggestion?
I have a table with two primary keys, but no foreign keys and the table update is showing an error depending on the configuration of "protected $primaryKey".
If I remove "protected $primaryKey" it displays an error message but updates {else} it displays an error message and does not update.
Is it valid or possible to inform both primary keys?
Model:
Code:
<? php namespace App \ Models;
// 20200512
use CodeIgniter \ Model;
class PlayersAlbumsModel extends Model
{
protected $table = 'players_albums';
protected $primaryKey = 'player_id';
protected $TimeStamps = false;
protected $useSoftDeletes = false;
protected $allowedFields = ['player_id', 'album_id', 'pick'];
}
Pleas, any suggestion?