You appear to be a bot. Output may be restricted
Description
Creates a model presentation.
Usage
$static = Abstract_Presentation::of( $data );
Parameters
- $data
- ( array ) required – The data that this is a presentation of.
Returns
static A model presentation.
Source
File name: wordpress-seo/src/presentations/abstract-presentation.php
Lines:
1 to 13 of 13
public function of( $data ) { if ( ! $this->is_prototype() ) { throw new Exception( 'Attempting to create a model presentation from another model presentation. Use the prototype presentation gained from DI instead.' ); } // Clone self to allow stateful services that do benefit from DI. $presentation = clone $this; foreach ( $data as $key => $value ) { $presentation->{$key} = $value; } $presentation->is_prototype = false; return $presentation; }