Commit e01e4194 authored by damiankloip's avatar damiankloip Committed by tim.plunkett

Refactored attachDisplays() method to use get/set methods

parent 752319c1
......@@ -273,4 +273,4 @@ function set_item_option($display_id, $type, $id, $option, $value) {
$this->set_item($display_id, $type, $id, $item);
}
}
\ No newline at end of file
}
......@@ -110,11 +110,13 @@ public function create(array $values) {
*/
protected function attachDisplays(&$entity) {
if (isset($entity->display) && is_array($entity->display)) {
foreach ($entity->display as $key => $options) {
$displays = array();
foreach ($entity->get('display') as $key => $options) {
// Create a ViewsDisplay object using the display options.
$entity->display[$key] = new ViewsDisplay($options);
$displays[$key] = new ViewsDisplay($options);
}
$entity->set('display', $displays);
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment