public ViewExecutable::destroy()
Unsets references so that a $view object may be properly garbage collected.
File
- core/modules/views/src/ViewExecutable.php, line 2050
Class
- ViewExecutable
- Represents a view as a whole.
Namespace
Drupal\views
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | public function destroy() { foreach ( $this ::getHandlerTypes() as $type => $info ) { if (isset( $this -> $type )) { foreach ( $this ->{ $type } as $handler ) { $handler ->destroy(); } } } if (isset( $this ->style_plugin)) { $this ->style_plugin->destroy(); } $reflection = new \ReflectionClass( $this ); $defaults = $reflection ->getDefaultProperties(); // The external dependencies should not be reset. This is not generated by // the execution of a view. unset( $defaults [ 'storage' ], $defaults [ 'user' ], $defaults [ 'request' ], $defaults [ 'routeProvider' ], $defaults [ 'viewsData' ] ); foreach ( $defaults as $property => $default ) { $this ->{ $property } = $default ; } } |
Please login to continue.