Skip to content
Snippets Groups Projects
Commit e01e4194 authored by Damian Lee's avatar Damian Lee Committed by Tim Plunkett
Browse files

Refactored attachDisplays() method to use get/set methods

parent 752319c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment