/** * Creates a new instance of this class. * * @param int $reference the `post_id` or a page URL that uniquely identifies a page. * @param boolean $internal whether this page is internal to WordPress or external. * Default: `true`. * * @return NelioABPageAccessedAction a new instance of this class. * * @since PHPDOC */ public function __construct($reference, $internal = true) { if (!$internal) { parent::__construct(NelioABAction::EXTERNAL_PAGE_ACCESSED); } else { parent::__construct(NelioABAction::POST_ACCESSED); } $this->reference = $reference; $this->title = __('Undefined', 'nelioab'); $this->indirect = false; $this->internal = $internal; // Fixing type appropriately if ($internal) { $p = get_post($this->get_reference(), ARRAY_A); if ($p) { if ($p['post_type'] == 'page') { $this->type = NelioABAction::PAGE_ACCESSED; } else { $this->type = NelioABAction::POST_ACCESSED; } } } }
/** * Creates a new instance of this class. * * @param string $type PHPDOC * @param string $form_id PHPDOC * * @return NelioABFormSubmissionAction a new instance of this class. * * @since PHPDOC */ public function __construct($type, $form_id) { parent::__construct($type); $this->form_id = $form_id; $this->indirect = false; }
/** * Creates a new instance of this class. * * @param string $mode PHPDOC * @param string $value PHPDOC * * @return NelioABClickElementAction a new instance of this class. * * @since PHPDOC */ public function __construct($mode, $value) { parent::__construct(self::CLICK_ELEMENT); $this->mode = $mode; $this->value = $value; }
/** * Creates a new instance of this class. * * @param int $product_id the `product_id` that identifies a product. * * @return NelioABWooCommerceOrderCompletedAction a new instance of this class. * * @since PHPDOC */ public function __construct($product_id) { parent::__construct(NelioABAction::WC_ORDER_COMPLETED); $this->product_id = $product_id; }