Spalte 'adressis_facturation. Datetime. < /P>
Code: Select all
public function getAdresse(int $idAdresse): ?object
{
return $this->where(['idFacturation' => $idAdresse, 'suppression' => null])->first();
}
< /code>
Mein Modell: < /p>
class AdressesFacturationModel extends Model
{
protected $DBGroup = 'default';
protected $table = 'adresses_facturation'; //Nom de la table
protected $primaryKey = 'idFacturation'; //Clé primaire de la table
protected $useAutoIncrement = true;
protected $returnType = 'object'; // ou array ou object
protected $useSoftDeletes = true;
protected $allowedFields = [
'idFacturation',
'civilite',
'nom',
'prenom',
'entreprise',
'adresse',
'complement',
'postal',
'ville',
'telephone',
'email',
'idPays',
'defaut',
'utilisateurs_idUtilisateur'
];
protected $useTimestamps = true;
protected $createdField = 'creation';
protected $updatedField = 'modification';
protected $deletedField = 'suppression';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $dateFormat = 'datetime';
< /code>
Im Moment habe ich als Code gemacht: < /p>
public function getAdresse(int $idAdresse): ?object
{
return $this->where(['idFacturation' => $idAdresse, 'suppression' => null])->get()->getRow();
}