Skip to content

Commit

Permalink
Ensure all fields describe elements using elementInfo().
Browse files Browse the repository at this point in the history
  • Loading branch information
laceysanderson committed Oct 7, 2020
1 parent e922c01 commit cc074fa
Show file tree
Hide file tree
Showing 13 changed files with 307 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,58 @@ class hp__phenotypic_variability extends ChadoField {
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
'elements' => array(
// Trait
'NCIT:C85496' => array(
'searchable' => FALSE,
'name' => 'Trait Name',
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
// Experiment.
'SIO:001066' => array(
'searchable' => FALSE,
'name' => 'Experiment Name',
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
// Method.
'NCIT:C71460' => array(
'searchable' => FALSE,
'name' => 'Methodology',
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
// Unit.
'uo:unit' => array(
'searchable' => FALSE,
'name' => 'Unit',
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
'schema:url' => array(
'searchable' => FALSE,
'name' => 'URL',
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
),
),
);
}

}


Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,32 @@ class local__child_studies extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
'elements' => array(
'local:child_studies' => array(
'searchable' => FALSE,
'name' => 'Child Studies',
'operations' => array(),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
),
),
);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,21 @@ class local__magnitude_of_phenotypes extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,19 @@ class local__number_of_experiments extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,19 @@ class local__number_of_germplasm extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,19 @@ class local__number_of_locations extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,19 @@ class local__number_of_traits extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,19 @@ class local__number_of_values_recorded extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,19 @@ class local__number_of_years extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
),
);
}
}
35 changes: 35 additions & 0 deletions includes/TripalFields/ncit__data/ncit__data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,39 @@ class ncit__data extends TripalField {

return $element;
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
'elements' => array(
'NCIT:data' => array(
'searchable' => FALSE,
'name' => 'Data',
'operations' => array(),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
'schema:additionalType' => array(
'searchable' => FALSE,
'name' => 'Type',
'operations' => array(),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
),
),
);
}
}
26 changes: 26 additions & 0 deletions includes/TripalFields/ncit__image/ncit__image.inc
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,30 @@ class ncit__image extends ChadoField {
$entity->{$field_name}['und'][0]['value'] = '';
}
}

/**
* @see ChadoField::elementInfo()
*
*/
public function elementInfo() {
$field_term = $this->getFieldTermID();
return array(
$field_term => array(
'operations' => array('eq', 'ne', 'contains', 'starts'),
'sortable' => TRUE,
'searchable' => TRUE,
'elements' => array(
'NCIT:C48179' => array(
'searchable' => FALSE,
'name' => 'Data',
'operations' => array(),
'sortable' => FALSE,
'type' => 'xs:string',
'readonly' => TRUE,
'required' => FALSE,
),
),
),
);
}
}
32 changes: 13 additions & 19 deletions includes/TripalFields/ncit__method/ncit__method.inc
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,6 @@ class ncit__method extends ChadoField {
}
}

/**
* @see ChadoField::query()
*
*/
public function query($query, $condition) {
}

/**
* @see ChadoField::queryOrder()
*
*/
public function queryOrder($query, $order) {
}


/**
* @see ChadoField::elementInfo()
*
Expand All @@ -190,11 +175,20 @@ class ncit__method extends ChadoField {
'type' => 'xs:complexType',
'readonly' => TRUE,
'elements' => array(
'NCIT:C71460' => array(
'searchable' => TRUE,
'name' => 'Phenotyping Method',
'schema:name' => array(
'searchable' => FALSE,
'name' => 'Method Name',
'operations' => ['eq', 'ne', 'contains', 'starts'],
'sortable' => FALSE,
'readonly' => TRUE,
'type' => 'xs:string',
'required' => FALSE,
),
'IAO:0000115' => array(
'searchable' => FALSE,
'name' => 'Method description',
'operations' => ['eq', 'ne', 'contains', 'starts'],
'sortable' => TRUE,
'sortable' => FALSE,
'readonly' => TRUE,
'type' => 'xs:string',
'required' => FALSE,
Expand Down
Loading

0 comments on commit cc074fa

Please sign in to comment.