Welcome to mirror list, hosted at ThFree Co, Russian Federation.

APIable.php « API « modules - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e7987f0df45017eb0ec2ee50011836f459bb589a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
 * This class is the parent class of all the modules that can be called using the 
 * API Proxy.
 * 
 * @package Piwik_API
 */
require_once "Archive.php";

class Piwik_Apiable 
{
	static public $methodsNotToPublish = array();
	
	protected function __construct()
	{
	}

	/**
	 * Register a public method as "not to be published in the API".
	 * Sometimes methods have to be marked as public to be used by other classes but
	 * we don't want these methods to be called from outside the application.
	 * 
	 * @param string Method name not to be published
	 */
	protected function doNotPublishMethod( $methodName )
	{
		if(!method_exists($this, $methodName))
		{
			throw new Exception("The method $methodName doesn't exist so it can't be added to the list of the methods not to be published in the API.");
		}
		$this->methodsNotToPublish[] = $methodName;
	}
}