developer.jelix.org is not used any more and exists only for
history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
Opened 10 years ago
Last modified 9 years ago
#1276 confirmed enhancement
jDao : property to records of a foreign table
Reported by: | geekbay | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | jelix:dao | Version: | 1.2.1 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Documentation needed: | no | |
Hosting Provider: | Php version: |
Description
Le cas est le suivant: on a 2 tables: authors qui contient id et d'autres propriétés pas importantes ici, et books qui contient id, author_id et name
il pourrait être intéressant dans la dao de books de pouvoir faire quelques chose comme ca
<property name="author" datasource="dao" dao="admin~authors" method="get" criteriafrom="author_id" />
et après dans ma dao si je fais par exemple
$book = $bookDao->get(1);
j'aurais $book->author qui est un daoRecord comme si j'avais écris:
$book->author = $authorDao->get($book->author_id);
j'ai mis datasource="dao" car on pourrait avoir datasource="class" par exemple.
voila vous en pensez quoi ?
Change History (3)
comment:1 Changed 10 years ago by foxmask
comment:2 Changed 9 years ago by laurentj
- Component changed from jelix to jelix:dao
- Summary changed from Nouveau type de propriete pour jDao to jDao : property to records of a foreign table
comment:3 Changed 9 years ago by laurentj
- Status changed from new to confirmed
Note: See
TracTickets for help on using
tickets.
et il est où le patch ? *<:o)
Ba moi ca me plait bien !