1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- function tripal_natural_diversity_preprocess_tripal_stock_nd_genotypes(&$variables) {
- $stock = $variables['node']->stock;
-
-
-
- $sql = "
- SELECT NDEG.nd_experiment_genotype_id
- FROM {nd_experiment_stock} NDES
- INNER JOIN {nd_experiment_genotype} NDEG ON NDEG.nd_experiment_id = NDES.nd_experiment_id
- WHERE NDES.stock_id = :stock_id
- ";
- $results = chado_query($sql, [':stock_id' => $stock->stock_id]);
- $nd_exp_ids = [];
- foreach ($results as $result) {
- $nd_exp_ids[] = $result->nd_experiment_genotype_id;
- }
- $stock->nd_experiment_genotype_ids = $nd_exp_ids;
- }
- function tripal_natural_diversity_preprocess_tripal_stock_nd_phenotypes(&$variables) {
- $stock = $variables['node']->stock;
-
-
-
- $sql = "
- SELECT NDEP.nd_experiment_phenotype_id
- FROM {nd_experiment_stock} NDES
- INNER JOIN {nd_experiment_phenotype} NDEP ON NDEP.nd_experiment_id = NDES.nd_experiment_id
- WHERE NDES.stock_id = :stock_id
- ";
- $results = chado_query($sql, [':stock_id' => $stock->stock_id]);
- $nd_exp_ids = [];
- foreach ($results as $result) {
- $nd_exp_ids[] = $result->nd_experiment_phenotype_id;
- }
- $stock->nd_experiment_phenotype_ids = $nd_exp_ids;
- }
|