Refactored attachDisplays() method to use get/set methods

8.0.x
damiankloip 2012-08-26 21:44:22 +02:00 committed by Tim Plunkett
parent 752319c127
commit e01e4194dc
2 changed files with 6 additions and 4 deletions

View File

@ -273,4 +273,4 @@ class ViewStorage extends ConfigurableBase {
$this->set_item($display_id, $type, $id, $item);
}
}
}

View File

@ -110,11 +110,13 @@ class ViewStorageController extends ConfigStorageController {
*/
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);
}
}
}
}