PHP Class Yoast_Product

Mostra file Open project: yoast/license-manager Class Usage Examples

Protected Properties

Property Type Description
$api_url The URL of the shop running the EDD API.
$author The item author
$extension_url URL referring to the extension page
$file Relative file path to the plugin.
$item_name The item name in the EDD shop.
$item_url The absolute url on which users can purchase a license
$license_page_url Absolute admin URL on which users can enter their license key.
$product_id Product ID in backend system for quick lookup
$slug The theme slug or plugin file
$text_domain The text domain used for translating strings
$version The version number of the item

Public Methods

Method Description
__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 ) Yoast_Product constructor.
get_api_url ( ) : string
get_author ( ) : string
get_extension_url ( string $link_identifier = '' ) : string Returns the extension url if set, otherwise it will be the tracking url.
get_file ( ) : string Returns the file path relative to the plugins folder
get_item_name ( ) : string
get_item_url ( ) : string
get_license_page_url ( ) : string
get_product_id ( ) : integer Return the Product ID
get_slug ( ) : string
get_text_domain ( ) : string
get_tracking_url ( string $link_identifier = '' ) : string Gets a Google Analytics Campaign url for this product
get_transient_prefix ( ) : string Returns the dirname of the slug and limits it to 15 chars
get_version ( ) : string
set_api_url ( string $api_url )
set_author ( string $author )
set_extension_url ( string $extension_url ) Sets the extension url.
set_file ( string $file ) Sets the file path relative to the plugins folder
set_item_name ( string $item_name )
set_item_url ( string $item_url )
set_license_page_url ( string $license_page_url )
set_product_id ( integer $product_id ) Set the product ID
set_slug ( string $slug )
set_text_domain ( string $text_domain )
set_version ( string $version )

Private Methods

Method Description
add_campaign_attributes ( $url, $link_identifier )

Method Details

__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.

get_api_url() public method

public get_api_url ( ) : string
return string

get_author() public method

public get_author ( ) : string
return string

get_extension_url() public method

Returns the extension url if set, otherwise it will be the tracking url.
public get_extension_url ( string $link_identifier = '' ) : string
$link_identifier string
return string

get_file() public method

Returns the file path relative to the plugins folder
public get_file ( ) : string
return string

get_item_name() public method

public get_item_name ( ) : string
return string

get_item_url() public method

public get_item_url ( ) : string
return string

get_license_page_url() public method

public get_license_page_url ( ) : string
return string

get_product_id() public method

Return the Product ID
public get_product_id ( ) : integer
return integer

get_slug() public method

public get_slug ( ) : string
return string

get_text_domain() public method

public get_text_domain ( ) : string
return string

get_tracking_url() public method

Gets a Google Analytics Campaign url for this product
public get_tracking_url ( string $link_identifier = '' ) : string
$link_identifier string
return string The full URL

get_transient_prefix() public method

Returns the dirname of the slug and limits it to 15 chars
public get_transient_prefix ( ) : string
return string

get_version() public method

public get_version ( ) : string
return string

set_api_url() public method

public set_api_url ( string $api_url )
$api_url string

set_author() public method

public set_author ( string $author )
$author string

set_extension_url() public method

Sets the extension url.
public set_extension_url ( string $extension_url )
$extension_url string

set_file() public method

Sets the file path relative to the plugins folder
public set_file ( string $file )
$file string Relative file path to the plugin.

set_item_name() public method

public set_item_name ( string $item_name )
$item_name string

set_item_url() public method

public set_item_url ( string $item_url )
$item_url string

set_license_page_url() public method

public set_license_page_url ( string $license_page_url )
$license_page_url string

set_product_id() public method

Set the product ID
public set_product_id ( integer $product_id )
$product_id integer Product ID to set.

set_slug() public method

public set_slug ( string $slug )
$slug string

set_text_domain() public method

public set_text_domain ( string $text_domain )
$text_domain string

set_version() public method

public set_version ( string $version )
$version string

Property Details

$api_url protected_oe property

The URL of the shop running the EDD API.
protected $api_url

$author protected_oe property

The item author
protected $author

$extension_url protected_oe property

URL referring to the extension page
protected $extension_url

$file protected_oe property

Relative file path to the plugin.
protected $file

$item_name protected_oe property

The item name in the EDD shop.
protected $item_name

$item_url protected_oe property

The absolute url on which users can purchase a license
protected $item_url

$license_page_url protected_oe property

Absolute admin URL on which users can enter their license key.
protected $license_page_url

$product_id protected_oe property

Product ID in backend system for quick lookup
protected $product_id

$slug protected_oe property

The theme slug or plugin file
protected $slug

$text_domain protected_oe property

The text domain used for translating strings
protected $text_domain

$version protected_oe property

The version number of the item
protected $version