Projet

Général

Profil

Actions

Evolution #1875

ouvert

Consistent use of foreign entries

Ajouté par Johan Cwiklinski il y a 2 mois. Mis à jour il y a environ 2 mois.

Statut:
Nouveau
Priorité:
Normal
Assigné à:
Catégorie:
Backend
Version cible:
-
Début:
28/09/2024
Echéance:
% réalisé:

0%

Temps estimé:

Description

Foreign key related values are handled differently... Some rely on properties that can be either null, the id as integer, or even an object instance. Sometimes it's just object instance, other times just the ID...
That's quite hard to understand; and that also can cause issues if we want to rely on an ORM like Doctrine.

It must be changed so we have:
  • a local property name that uses the Object::PK,
  • another one for the instantiated object; loaded per dependency/on demand.

Some foreign values are only loaded on demand, but some other are always loaded and tha cannot be changed (Title in the Adherent class for example).

Mis à jour par Johan Cwiklinski il y a environ 2 mois

  • Catégorie changé de Core à Backend

Mis à jour par Johan Cwiklinski il y a environ 2 mois

Johan Cwiklinski a écrit :

It must be changed so we have:
  • a local property name that uses the Object::PK,
  • another one for the instantiated object; loaded per dependency/on demand.

In facts, maybe not... ORMs work with objects, not their PK value; and this is generally done like that in Galette (there are few inconsistencies to be reviewed and solved though).
But there is also a major specific case: the Adherent class which does not loads dependencies for performances reasons. In this case, if the dependency is loaded, we have an object instance, and if not, we have the integer PK value for reference (and maybe future load without a query on members table).

Actions

Formats disponibles : Atom PDF