• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Abstract_Presentation::of() – Creates a model presentation.

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;
  }
 

 View on GitHub View on Trac

Published: 2nd May 2020 | Last updated: 15th June 2020

Primary Sidebar

Information

Function name: Abstract_Presentation::of
Class ref: Abstract_Presentation
Plugin ref: Yoast SEO
Version: 20.2.1
Sourcefile: src/presentations/abstract-presentation.php
File ref: src/presentations/abstract-presentation.php
Deprecated?: No
API Letters: A,O,P

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 6.1.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites