Yoast_Product::__construct PHP Method

__construct() public method

Yoast_Product constructor.
public __construct ( string $api_url, string $item_name, string $slug, string $version, string $item_url = '', string $license_page_url = '#', string $text_domain = 'yoast', string $author = 'Yoast', string $file = '', integer $product_id )
$api_url string The URL of the shop running the EDD API.
$item_name string The item name in the EDD shop.
$slug string The slug of the plugin, for shiny updates this needs to be a valid HTML id.
$version string The version number of the item.
$item_url string The absolute url on which users can purchase a license.
$license_page_url string Absolute admin URL on which users can enter their license key.
$text_domain string The text domain used for translating strings.
$author string The item author.
$file string The relative file path to the plugin.
$product_id integer The ID of the product in the backend system.
        public function __construct($api_url, $item_name, $slug, $version, $item_url = '', $license_page_url = '#', $text_domain = 'yoast', $author = 'Yoast', $file = '', $product_id = 0)
        {
            $this->set_api_url($api_url);
            $this->set_item_name($item_name);
            $this->set_slug($slug);
            $this->set_version($version);
            $this->set_item_url($item_url);
            $this->set_license_page_url($license_page_url);
            $this->set_text_domain($text_domain);
            $this->set_author($author);
            $this->set_file($file);
            $this->set_product_id($product_id);
        }

Usage Example

 /**
  * Construct the real Product class with our fake data
  */
 public function __construct()
 {
     parent::__construct(get_site_url(), 'test-product', 'slug-test-product', '1.0.0');
 }
All Usage Examples Of Yoast_Product::__construct