sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
public function boot(): void { $this->mergeConfigFrom(__DIR__ . '/../config/amigrid.php', GridView::NAME); $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', GridView::NAME); $this->loadViewsFrom(__DIR__ . '/../resources/views', GridView::NAME); $this->publishes([ ...
Bootstrap the application services. @return void
entailment
public function register(): void { $this->app->bind(\Assurrussa\GridView\Interfaces\GridInterface::class, function ($app) { /** @var Container $app */ return $app->make(GridView::class); }); $this->app->alias(\Assurrussa\GridView\GridView::class, GridView::NAME); ...
Register the application services. Use a Helpers service provider that loads all .php files from a folder. @return void
entailment
protected function registerProviders(): void { foreach ($this->providers as $provider) { $this->app->register($provider); } }
Register the providers.
entailment
public function set($key, $value) { KeyUtil::validate($key); $this->array[$key] = call_user_func($this->serialize, $value); }
{@inheritdoc}
entailment
public function get($key, $default = null) { KeyUtil::validate($key); if (!array_key_exists($key, $this->array)) { return $default; } return call_user_func($this->unserialize, $this->array[$key]); }
{@inheritdoc}
entailment
public function getOrFail($key) { KeyUtil::validate($key); if (!array_key_exists($key, $this->array)) { throw NoSuchKeyException::forKey($key); } return call_user_func($this->unserialize, $this->array[$key]); }
{@inheritdoc}
entailment
public function getMultiple(array $keys, $default = null) { KeyUtil::validateMultiple($keys); $values = array(); foreach ($keys as $key) { $values[$key] = array_key_exists($key, $this->array) ? call_user_func($this->unserialize, $this->array[$key]) ...
{@inheritdoc}
entailment
public function getMultipleOrFail(array $keys) { KeyUtil::validateMultiple($keys); $notFoundKeys = array_diff($keys, array_keys($this->array)); if (count($notFoundKeys) > 0) { throw NoSuchKeyException::forKeys($notFoundKeys); } return $this->getMultiple($keys);...
{@inheritdoc}
entailment
public function remove($key) { KeyUtil::validate($key); $removed = array_key_exists($key, $this->array); unset($this->array[$key]); return $removed; }
{@inheritdoc}
entailment
public static function flushAuthorityEvents($controllerName = null) { $controllerName = $controllerName ?: get_called_class(); $events = app('events'); $listeners = (array) get_property($events, 'listeners'); foreach ($listeners as $eventName => $listener) { $remove = fa...
Remove all of the Authority-Controller event listeners of the specified controller. If $controllerName == '*', it removes all the Authority-Controller events of every Controllers of the application. \App\Http\Controllers\Controller::flushAuthorityEvents('*'); // Remove all Authority-Controller events of every Controll...
entailment
public function callAction($method, $parameters) { $route = app('router')->current(); $request = app('request'); $this->assignAfter($route, $request, $method); $response = $this->before($route, $request, $method); if (is_null($response)) { $response = call_user_f...
Execute an action on the controller. @param string $method @param array $parameters @return \Symfony\Component\HttpFoundation\Response
entailment
protected function filterApplies($filter, $request, $method) { if ($this->filterFailsMethod($filter, $request, $method)) { return false; } return true; }
Determine if the given filter applies to the request. @param array $filter @param \Illuminate\Http\Request $request @param string $method @return bool
entailment
protected function callFilter($filter, $route, $request) { return $this->callRouteFilter( $filter['filter'], $filter['parameters'], $route, $request ); }
Call the given controller filter method. @param array $filter @param \Illuminate\Routing\Route $route @param \Illuminate\Http\Request $request @return mixed
entailment
public function prependBeforeFilter($filter, array $options = []) { array_unshift($this->beforeFilters, $this->parseFilter($filter, $options)); }
Register a new "before" filter before any "before" filters on the controller. @param string $filter @param array $options @return void
entailment
public function prependAfterFilter($filter, array $options = []) { array_unshift($this->afterFilters, $this->parseFilter($filter, $options)); }
Register a new "after" filter before any "after" filters on the controller. @param string $filter @param array $options @return void
entailment
public function loadAndAuthorizeResource($args = null) { $args = is_array($args) ? $args : func_get_args(); ControllerResource::addBeforeFilter($this, __METHOD__, $args); }
Sets up a before filter which loads and authorizes the current resource. This performs both loadResource() and authorizeResource() and accepts the same arguments. See those methods for details. class BooksController extends Controller { public function __construct() { $this->loadAndAuthorizeResource(); } }
entailment
public function authorize($args = null) { $args = is_array($args) ? $args : func_get_args(); $this->_authorized = true; return call_user_func_array([$this->getCurrentAuthority(), 'authorize'], $args); }
Throws a Efficiently\AuthorityController\Exceptions\AccessDenied exception if the currentAuthority cannot perform the given action. This is usually called in a controller action or before filter to perform the authorization. public function show($id) { $this->article = Article::find($id); // Tips: instead of $id, you ...
entailment
public function can($args = null) { $args = is_array($args) ? $args : func_get_args(); return call_user_func_array([$this->getCurrentAuthority(), 'can'], $args); }
Use in the controller or view to check the user's permission for a given action and object. $this->can('destroy', $this->project); You can also pass the class instead of an instance (if you don't have one handy). @if (Authority::can('create', 'Project')) {{ link_to_route('projects.create', "New Project") }} @endif ...
entailment
public function cannot($args = null) { $args = is_array($args) ? $args : func_get_args(); return call_user_func_array([$this->getCurrentAuthority(), 'cannot'], $args); }
Convenience method which works the same as "can()" but returns the opposite value. $this->cannot('destroy', $this->project);
entailment
public function pack($v) { $stream = ''; if (is_string($v)) { $stream .= $this->packText($v); } elseif ($v instanceof CollectionInterface && $v instanceof Map) { $stream .= $this->packMap($v->getElements()); } elseif ($v instanceof CollectionInterface && $v in...
@param $v @return string
entailment
public function packStructureHeader($length, $signature) { $stream = ''; $packedSig = chr($signature); if ($length < Constants::SIZE_TINY) { $stream .= chr(Constants::STRUCTURE_TINY + $length); $stream .= $packedSig; return $stream; } if ...
@param int $length @param $signature @return string
entailment
public function getStructureMarker($length) { $length = (int) $length; $bytes = ''; if ($length < Constants::SIZE_TINY) { $bytes .= chr(Constants::STRUCTURE_TINY + $length); } elseif ($length < Constants::SIZE_MEDIUM) { // do } elseif ($length < Const...
@param int $length @return string
entailment
public function packList(array $array) { $size = count($array); $b = $this->getListSizeMarker($size); foreach ($array as $k => $v) { $b .= $this->pack($v); } return $b; }
@param array $array @return string
entailment
public function getListSizeMarker($size) { $b = ''; if ($size < Constants::SIZE_TINY) { $b .= chr(Constants::LIST_TINY + $size); return $b; } if ($size < Constants::SIZE_8) { $b .= chr(Constants::LIST_8); $b .= $this->packUnsignedSho...
@param $size @return string
entailment
public function packMap(array $array) { $size = count($array); $b = ''; $b .= $this->getMapSizeMarker($size); foreach ($array as $k => $v) { $b .= $this->pack($k); $b .= $this->pack($v); } return $b; }
@param array $array @return string
entailment
public function packFloat($v) { $str = chr(Constants::MARKER_FLOAT); return $str.strrev(pack('d', $v)); }
@param $v @return int|string
entailment
public function getMapSizeMarker($size) { $b = ''; if ($size < Constants::SIZE_TINY) { $b .= chr(Constants::MAP_TINY + $size); return $b; } if ($size < Constants::SIZE_8) { $b .= chr(Constants::MAP_8); $b .= $this->packUnsignedShortS...
@param int $size @return string
entailment
public function packText($value) { $length = strlen($value); $b = ''; if ($length < 16) { $b .= chr(Constants::TEXT_TINY + $length); $b .= $value; return $b; } if ($length < 256) { $b .= chr(Constants::TEXT_8); $b...
@param $value @return string @throws \OutOfBoundsException
entailment
public function packInteger($value) { $pow15 = pow(2, 15); $pow31 = pow(2, 31); $b = ''; if ($value > -16 && $value < 128) { //$b .= chr(Constants::INT_8); //$b .= $this->packBigEndian($value, 2); return $this->packSignedShortShort($value); ...
@param $value @return string @throws BoltOutOfBoundsException
entailment
public function isShort($integer) { $min = 128; $max = 32767; $minMin = -129; $minMax = -32768; return in_array($integer, range($min, $max)) || in_array($integer, range($minMin, $minMax)); }
@param int $integer @return bool
entailment
public function packBigEndian($x, $bytes) { if (($bytes <= 0) || ($bytes % 2)) { throw new BoltInvalidArgumentException(sprintf('Expected bytes count must be multiply of 2, %s given', $bytes)); } if (!is_int($x)) { throw new BoltInvalidArgumentException('Only integer...
@param int $x @param int $bytes @return array @throws BoltInvalidArgumentException
entailment
public function value($key, $default = null) { if (!array_key_exists($key, $this->properties) && 1 === func_num_args()) { throw new \InvalidArgumentException(sprintf('this object has no property with key %s', $key)); } return array_key_exists($key, $this->properties) ? $this->pr...
{@inheritdoc}
entailment
public function getJwtToken() { if ($this->token && $this->token->isValid()) { return $this->token; } $url = $this->options['token_url']; $requestOptions = array_merge( $this->getDefaultHeaders(), $this->auth->getRequestOptions() ); ...
getToken. @return JwtToken
entailment
public function onFailure($metadata) { $this->completed = true; $e = new MessageFailureException($metadata->getElements()['message']); $e->setStatusCode($metadata->getElements()['code']); throw $e; }
@param $metadata @throws MessageFailureException
entailment
public function getRequestOptions() { return [ \GuzzleHttp\RequestOptions::QUERY => [ $this->options['query_fields'][0] => $this->options['username'], $this->options['query_fields'][1] => $this->options['password'], ], ]; }
{@inheritdoc}
entailment
public function connect() { $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (!socket_connect($this->socket, $this->host, $this->port)) { $errno = socket_last_error($this->socket); $errstr = socket_strerror($errno); throw new IOException( ...
{@inheritdoc}
entailment
public function close() { if (is_resource($this->socket)) { echo 'closing'; socket_close($this->socket); } $this->socket = null; return true; }
{@inheritdoc}
entailment
public function write($data) { $len = mb_strlen($data, 'ASCII'); while (true) { // Null sockets are invalid, throw exception if (is_null($this->socket)) { throw new IOException(sprintf( 'Socket was null! Last SocketError was: %s', ...
{@inheritdoc}
entailment
public function read($n) { $res = ''; $read = 0; $buf = socket_read($this->socket, $n); while ($read < $n && $buf !== '' && $buf !== false) { $read += mb_strlen($buf, 'ASCII'); $res .= $buf; $buf = socket_read($this->socket, $n - $read); ...
{@inheritdoc}
entailment
public function register() { $this->app['laraveleasyrec'] = $this->app->share(function($app) { $config = []; foreach (['baseURL', 'apiKey', 'tenantID', 'apiVersion'] as $value) $config[$value] = $this->app->config->get('easyrec.'.$value); return new Easyrec($config); }); }
Register the service provider. @return void
entailment
public function convertStructureToSuccessMessage(MessageStructure $structure, RawMessage $rawMessage) { $message = new SuccessMessage($structure->getElements()[0]); $message->setSerialization($rawMessage->getBytes()); return $message; }
@param MessageStructure $structure @param RawMessage $rawMessage @return SuccessMessage
entailment
public function convertStructureToRecordMessage(MessageStructure $structure, RawMessage $rawMessage) { $message = new RecordMessage($structure->getElements()[0]); $message->setSerialization($rawMessage->getBytes()); return $message; }
@param MessageStructure $structure @param RawMessage $rawMessage @return RecordMessage
entailment
public function convertStructureToFailureMessage(MessageStructure $structure, RawMessage $rawMessage) { $message = new FailureMessage($structure->getElements()[0]); $message->setSerialization($rawMessage->getBytes()); return $message; }
@param MessageStructure $structure @param RawMessage $rawMessage @return FailureMessage
entailment
public function getRequestOptions() { return [ \GuzzleHttp\RequestOptions::JSON => [ $this->options['json_fields'][0] => $this->options['username'], $this->options['json_fields'][1] => $this->options['password'], ], ]; }
{@inheritdoc}
entailment
public function unpackElement(BytesWalker $walker) { $marker = $walker->read(1); $byte = hexdec(bin2hex($marker)); $ordMarker = ord($marker); $markerHigh = $ordMarker & 0xf0; $markerLow = $ordMarker & 0x0f; // Structures if (0xb0 <= $ordMarker && $ordMarker <...
@param \GraphAware\Bolt\PackStream\BytesWalker $walker @return \GraphAware\Bolt\PackStream\Structure\Structure
entailment
public function unpackNode(BytesWalker $walker) { $identity = $this->unpackElement($walker); $labels = $this->unpackElement($walker); $properties = $this->unpackElement($walker); return new Node($identity, $labels, $properties); }
@param BytesWalker $walker @return Node
entailment
public function unpackRelationship(BytesWalker $walker) { $identity = $this->unpackElement($walker); $startNode = $this->unpackElement($walker); $endNode = $this->unpackElement($walker); $type = $this->unpackElement($walker); $properties = $this->unpackElement($walker); ...
@param BytesWalker $walker @return Relationship
entailment
public function unpackMap($size, BytesWalker $walker) { $map = []; for ($i = 0; $i < $size; ++$i) { $identifier = $this->unpackElement($walker); $value = $this->unpackElement($walker); $map[$identifier] = $value; } return $map; }
@param int $size @param BytesWalker $walker @return array
entailment
public function unpackList($size, BytesWalker $walker) { $size = (int) $size; $list = []; for ($i = 0; $i < $size; ++$i) { $list[] = $this->unpackElement($walker); } return $list; }
@param int $size @param BytesWalker $walker @return array
entailment
public function getStructureSize(BytesWalker $walker) { $marker = $walker->read(1); // if tiny size, no more bytes to read, the size is encoded in the low nibble if ($this->isMarkerHigh($marker, Constants::STRUCTURE_TINY)) { return $this->getLowNibbleValue($marker); } ...
@param BytesWalker $walker @return int
entailment
public function getSignature(BytesWalker $walker) { static $signatures = [ Constants::SIGNATURE_SUCCESS => self::SUCCESS, Constants::SIGNATURE_FAILURE => self::FAILURE, Constants::SIGNATURE_RECORD => self::RECORD, Constants::SIGNATURE_IGNORE => self::IGNORED, ...
@param BytesWalker $walker @return string
entailment
public function isMarkerHigh($byte, $nibble) { $marker_raw = ord($byte); $marker = $marker_raw & 0xF0; return $marker === $nibble; }
@param $byte @param $nibble @return bool
entailment
public function readSignedShort(BytesWalker $walker) { list(, $v) = unpack('s', $this->correctEndianness($walker->read(2))); return $v; }
@param BytesWalker $walker @return mixed
entailment
public function readUnsignedLong(BytesWalker $walker) { list(, $v) = unpack('N', $walker->read(4)); return sprintf('%u', $v); }
@param BytesWalker $walker @return mixed
entailment
public function readSignedLongLong(BytesWalker $walker) { list(, $high, $low) = unpack('N2', $walker->read(8)); return (int) bcadd($high << 32, $low, 0); }
@param BytesWalker $walker @return int
entailment
public function isInRange($start, $end, $byte) { $range = range($start, $end); return in_array(ord($byte), $range); }
@param int $start @param int $end @param string $byte @return mixed
entailment
public function read_longlong(BytesWalker $walker) { $this->bitcount = $this->bits = 0; list(, $hi, $lo) = unpack('N2', $walker->read(8)); $msb = self::getLongMSB($hi); if (!$this->is64bits) { if ($msb) { $hi = sprintf('%u', $hi); } ...
@param BytesWalker $walker @return string
entailment
private function correctEndianness($byteString) { $tmp = unpack('S', "\x01\x00"); $isLittleEndian = $tmp[1] == 1; return $isLittleEndian ? strrev($byteString) : $byteString; }
@param string $byteString @return string
entailment
public function setDate(string $date = null): Matomo { $this->_date = $date; $this->_rangeStart = null; $this->_rangeEnd = null; return $this; }
Set date @param string $date Format Y-m-d or class constant: DATE_TODAY DATE_YESTERDAY @return $this
entailment
public function getRange(): string { if (empty($this->_rangeEnd)) { return $this->_rangeStart; } else { return $this->_rangeStart . ',' . $this->_rangeEnd; } }
Get the date range comma separated @return string
entailment
public function setRange(string $rangeStart = null, string $rangeEnd = null): Matomo { $this->_date = ''; $this->_rangeStart = $rangeStart; $this->_rangeEnd = $rangeEnd; if (is_null($rangeEnd)) { if (strpos($rangeStart, 'last') !== false || strpos($rangeStart, 'previous'...
Set date range @param string $rangeStart e.g. 2012-02-10 (YYYY-mm-dd) or last5(lastX), previous12(previousY)... @param string $rangeEnd e.g. 2012-02-12. Leave this parameter empty to request all data from $rangeStart until now @return $this
entailment
public function reset(): Matomo { $this->_period = self::PERIOD_DAY; $this->_date = ''; $this->_rangeStart = 'yesterday'; $this->_rangeEnd = null; return $this; }
Reset all default variables.
entailment
private function _request(string $method, array $params = [], array $optional = []) { $url = $this->_parseUrl($method, $params + $optional); if ($url === false) { throw new InvalidRequestException('Could not parse URL!'); } $req = Request::get($url); $req->strict...
Make API request @param string $method @param array $params @param array $optional @return bool|object @throws InvalidRequestException
entailment
private function _finishResponse($response, string $method, array $params) { $valid = $this->_isValidResponse($response); if ($valid === true) { if (isset($response->value)) { return $response->value; } else { return $response; } ...
Validate request and return the values. @param mixed $response @param string $method @param array $params @return bool|object @throws InvalidResponseException
entailment
private function _parseUrl(string $method, array $params = []) { $params = [ 'module' => 'API', 'method' => $method, 'token_auth' => $this->_token, 'idSite' => $this->_siteId, 'period' => $this->_period, 'format'...
Create request url with parameters @param string $method The request method @param array $params Request params @return string|false @throws \InvalidArgumentException
entailment
private function _isValidResponse($response) { if (is_null($response)) { return self::ERROR_EMPTY; } if (!isset($response->result) or ($response->result != 'error')) { return true; } return $response->message; }
Check if the request was successfull. @param mixed $response @return bool|int
entailment
private function _parseResponse(Response $response) { switch ($this->_format) { case self::FORMAT_JSON: return json_decode($response, $this->_isJsonDecodeAssoc); break; default: return $response; } }
Parse request result @param Response $response @return mixed
entailment
public function getMetadata($apiModule, $apiAction, $apiParameters = [], array $optional = []) { return $this->_request('API.getMetadata', [ 'apiModule' => $apiModule, 'apiAction' => $apiAction, 'apiParameters' => $apiParameters, ], $optional); }
Get metadata from the API @param string $apiModule Module @param string $apiAction Action @param array $apiParameters Parameters @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getReportMetadata( array $idSites, $hideMetricsDoc = '', $showSubtableReports = '', array $optional = [] ) { return $this->_request('API.getReportMetadata', [ 'idSites' => $idSites, 'hideMetricsDoc' => $hideMetricsDoc, '...
Get metadata from a report @param array $idSites Array with the ID's of the sites @param string $hideMetricsDoc @param string $showSubtableReports @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getProcessedReport( $apiModule, $apiAction, $segment = '', $apiParameters = '', $idGoal = '', $showTimer = '1', $hideMetricsDoc = '', array $optional = [] ) { return $this->_request('API.getProcessedReport', [ 'a...
Get processed report @param string $apiModule Module @param string $apiAction Action @param string $segment @param string $apiParameters @param int|string $idGoal @param bool|string $showTimer @param string $hideMetricsDoc @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getRowEvolution( $apiModule, $apiAction, $segment = '', $column = '', $idGoal = '', $legendAppendMetric = '1', $labelUseAbsoluteUrl = '1', array $optional = [] ) { return $this->_request('API.getRowEvolution', [ ...
Get row evolution @param $apiModule @param $apiAction @param string $segment @param $column @param string $idGoal @param string $legendAppendMetric @param string $labelUseAbsoluteUrl @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getBulkRequest($methods = [], array $optional = []) { $urls = []; foreach ($methods as $key => $method) { $urls['urls[' . $key . ']'] = urlencode('method=' . $method); } return $this->_request('API.getBulkRequest', $urls, $optional); }
Get the result of multiple requests bundled together Take as an argument an array of the API methods to send together For example, ['API.get', 'Action.get', 'DeviceDetection.getType'] @param array $methods @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function saveAnnotation($idNote, $note = '', $starred = '', array $optional = []) { return $this->_request('Annotations.save', [ 'idNote' => $idNote, 'note' => $note, 'starred' => $starred, ], $optional); }
Save annotation @param int $idNote @param string $note @param string $starred @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function addAlert( $name, $idSites, $emailMe, $additionalEmails, $phoneNumbers, $metric, $metricCondition, $metricValue, $comparedTo, $reportUniqueId, $reportCondition = '', $reportValue = '', array $optional ...
Add alert @param string $name @param array $idSites Array of site IDs @param int $emailMe @param string $additionalEmails @param string $phoneNumbers @param string $metric @param string $metricCondition @param string $metricValue @param string $comparedTo @param string $reportUniqueId @param string $reportCondition @p...
entailment
public function configureNewCustomDimension($name, $scope, $active, array $optional = []) { return $this->_request('CustomDimensions.configureNewCustomDimension', [ 'name' => $name, 'scope' => $scope, 'active' => $active, ], $optional); }
Configures a new Custom Dimension. Note that Custom Dimensions cannot be deleted, be careful when creating one as you might run quickly out of available Custom Dimension slots. Requires at least Admin access for the specified website. A current list of available `$scopes` can be fetched via the API method `CustomDimens...
entailment
public function configureExistingCustomDimension($idDimension, $name, $active, array $optional = []) { return $this->_request('CustomDimensions.configureExistingCustomDimension', [ 'idDimension' => $idDimension, 'name' => $name, 'active' => $active, ], $optional);...
Updates an existing Custom Dimension. This method updates all values, you need to pass existing values of the dimension if you do not want to reset any value. Requires at least Admin access for the specified website. @param int $idDimension The id of a Custom Dimension. @param string $name The name of the dimension @p...
entailment
public function sendFeedbackForFeature($featureName, $like, $message = '', array $optional = []) { return $this->_request('Feedback.sendFeedbackForFeature', [ 'featureName' => $featureName, 'like' => $like, 'message' => $message, ], $optional); }
Get a multidimensional array @param string $featureName @param string $like @param string $message @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function addGoal( $name, $matchAttribute, $pattern, $patternType, $caseSensitive = '', $revenue = '', $allowMultipleConversionsPerVisit = '', array $optional = [] ) { return $this->_request('Goals.addGoal', [ 'name' => $n...
Add a goal @param string $name @param string $matchAttribute @param string $pattern @param string $patternType @param string $caseSensitive @param string $revenue @param string $allowMultipleConversionsPerVisit @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function updateGoal( $idGoal, $name, $matchAttribute, $pattern, $patternType, $caseSensitive = '', $revenue = '', $allowMultipleConversionsPerVisit = '', array $optional = [] ) { return $this->_request('Goals.updateGoal', [ ...
Update a goal @param int $idGoal @param string $name @param string $matchAttribute @param string $pattern @param string $patternType @param string $caseSensitive @param string $revenue @param string $allowMultipleConversionsPerVisit @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getGoal($segment = '', $idGoal = '', $columns = [], array $optional = []) { return $this->_request('Goals.get', [ 'segment' => $segment, 'idGoal' => $idGoal, 'columns' => $columns, ], $optional); }
Get conversion rates from a goal @param string $segment @param string $idGoal @param array $columns @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getImageGraph( $apiModule, $apiAction, $graphType = '', $outputType = '0', $columns = '', $labels = '', $showLegend = '1', $width = '', $height = '', $fontSize = '9', $legendFontSize = '', $aliasedGraph = '1'...
Generate a png report @param string $apiModule Module @param string $apiAction Action @param string $graphType 'evolution', 'verticalBar', 'pie' or '3dPie' @param string $outputType @param string $columns @param string $labels @param string $showLegend @param int|string $width @param int|string $height @param int|stri...
entailment
public function getMoversAndShakers( $reportUniqueId, $segment, $comparedToXPeriods = 1, $limitIncreaser = 4, $limitDecreaser = 4, array $optional = [] ) { return $this->_request('Insights.getMoversAndShakers', [ 'reportUniqueId' => $reportUniq...
Get movers and shakers @param int $reportUniqueId @param string $segment @param int $comparedToXPeriods @param int $limitIncreaser @param int $limitDecreaser @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getInsights( $reportUniqueId, $segment, $limitIncreaser = 5, $limitDecreaser = 5, $filterBy = '', $minImpactPercent = 2, $minGrowthPercent = 20, $comparedToXPeriods = 1, $orderBy = 'absolute', array $optional = [] ) ...
Get insights @param int $reportUniqueId @param string $segment @param int $limitIncreaser @param int $limitDecreaser @param string $filterBy @param int $minImpactPercent (0-100) @param int $minGrowthPercent (0-100) @param int $comparedToXPeriods @param string $orderBy @param array $optional @return bool|object @throws...
entailment
public function getLastVisitsDetails($segment = '', $minTimestamp = '', $doNotFetchActions = '', array $optional = []) { return $this->_request('Live.getLastVisitsDetails', [ 'segment' => $segment, 'minTimestamp' => $minTimestamp, 'doNotFetchActions' => $doNotFetchActions...
Get information about the last visits @param string $segment @param string $minTimestamp @param string $doNotFetchActions @param array $optional @return bool|object @throws InvalidRequestException @internal param int $maxIdVisit @internal param int $filterLimit
entailment
public function addReport( $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = '', array $optional = [] ) { return $this->_request('ScheduledReports.addReport', [ 'description' =...
Add scheduled report @param string $description @param string $period @param string $hour @param string $reportType @param string $reportFormat @param array $reports @param string $parameters @param string $idSegment @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function updateReport( $idReport, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = '', array $optional = [] ) { return $this->_request('ScheduledReports.updateReport', [ ...
Updated scheduled report @param int $idReport @param string $description @param string $period @param string $hour @param string $reportType @param string $reportFormat @param array $reports @param string $parameters @param string $idSegment @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getReports( $idReport = '', $ifSuperUserReturnOnlySuperUserReports = '', $idSegment = '', array $optional = [] ) { return $this->_request('ScheduledReports.getReports', [ 'idReport' => $idReport, 'ifSuperUserReturnOnlySuperUserRepor...
Get list of scheduled reports @param string $idReport @param string $ifSuperUserReturnOnlySuperUserReports @param string $idSegment @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function generateReport( $idReport, $language = '', $outputType = '', $reportFormat = '', $parameters = '', array $optional = [] ) { return $this->_request('ScheduledReports.generateReport', [ 'idReport' => $idReport, 'langua...
Get list of scheduled reports @param int $idReport @param string $language @param string $outputType @param string $reportFormat @param string $parameters @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function updateSegment( $idSegment, $name, $definition, $autoArchive = '', $enableAllUsers = '', array $optional = [] ) { return $this->_request('SegmentEditor.update', [ 'idSegment' => $idSegment, 'name' => $name, ...
Updates a segment @param int $idSegment @param string $name @param string $definition @param string $autoArchive @param string $enableAllUsers @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function addSegment($name, $definition, $autoArchive = '', $enableAllUsers = '', array $optional = []) { return $this->_request('SegmentEditor.add', [ 'name' => $name, 'definition' => $definition, 'autoArchive' => $autoArchive, 'enableAllUsers' => $enab...
Updates a segment @param string $name @param string $definition @param string $autoArchive @param string $enableAllUsers @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getJavascriptTag( $matomoUrl, $mergeSubdomains = '', $groupPageTitlesByDomain = '', $mergeAliasUrls = '', $visitorCustomVariables = '', $pageCustomVariables = '', $customCampaignNameQueryParam = '', $customCampaignKeywordParam = '', ...
Get the JS tag of the current site @param string $matomoUrl @param string $mergeSubdomains @param string $groupPageTitlesByDomain @param string $mergeAliasUrls @param string $visitorCustomVariables @param string $pageCustomVariables @param string $customCampaignNameQueryParam @param string $customCampaignKeywordParam ...
entailment
public function getImageTrackingCode( $matomoUrl, $actionName = '', $idGoal = '', $revenue = '', array $optional = [] ) { return $this->_request('SitesManager.getImageTrackingCode', [ 'piwikUrl' => $matomoUrl, 'actionName' => $actionName, ...
Get image tracking code of the current site @param string $matomoUrl @param string $actionName @param string $idGoal @param string $revenue @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function addSite( $siteName, $urls, $ecommerce = '', $siteSearch = '', $searchKeywordParameters = '', $searchCategoryParameters = '', $excludeIps = '', $excludedQueryParameters = '', $timezone = '', $currency = '', $group = '...
Add a website. Requires Super User access. The website is defined by a name and an array of URLs. @param string $siteName Site name @param string $urls Comma separated list of urls @param string $ecommerce Is Ecommerce Reporting enabled for this website? @param string $siteSearch @param string $searchKeywordParameters...
entailment
public function updateSite( $siteName, $urls, $ecommerce = '', $siteSearch = '', $searchKeywordParameters = '', $searchCategoryParameters = '', $excludeIps = '', $excludedQueryParameters = '', $timezone = '', $currency = '', $group ...
Update current site @param string $siteName @param array $urls @param bool|string $ecommerce @param bool|string $siteSearch @param string $searchKeywordParameters @param string $searchCategoryParameters @param array|string $excludeIps @param array|string $excludedQueryParameters @param string $timezone @param string $...
entailment
public function getTransitionsForPageTitle($pageTitle, $segment = '', $limitBeforeGrouping = '', array $optional = []) { return $this->_request('Transitions.getTransitionsForPageTitle', [ 'pageTitle' => $pageTitle, 'segment' => $segment, 'limitBeforeGrouping' => $limitBef...
Get transitions for a page title @param $pageTitle @param string $segment @param string $limitBeforeGrouping @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getTransitionsForPageUrl($pageUrl, $segment = '', $limitBeforeGrouping = '', array $optional = []) { return $this->_request('Transitions.getTransitionsForPageTitle', [ 'pageUrl' => $pageUrl, 'segment' => $segment, 'limitBeforeGrouping' => $limitBeforeGroup...
Get transitions for a page URL @param $pageUrl @param string $segment @param string $limitBeforeGrouping @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function getTransitionsForAction( $actionName, $actionType, $segment = '', $limitBeforeGrouping = '', $parts = 'all', $returnNormalizedUrls = '', array $optional = [] ) { return $this->_request('Transitions.getTransitionsForAction', [ ...
Get transitions for a page URL @param $actionName @param $actionType @param string $segment @param string $limitBeforeGrouping @param string $parts @param string $returnNormalizedUrls @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function setUserPreference($userLogin, $preferenceName, $preferenceValue, array $optional = []) { return $this->_request('UsersManager.setUserPreference', [ 'userLogin' => $userLogin, 'preferenceName' => $preferenceName, 'preferenceValue' => $preferenceValue, ...
Set user preference @param string $userLogin Username @param string $preferenceName @param string $preferenceValue @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function addUser($userLogin, $password, $email, $alias = '', array $optional = []) { return $this->_request('UsersManager.addUser', [ 'userLogin' => $userLogin, 'password' => $password, 'email' => $email, 'alias' => $alias, ], $optional); }
Add a user @param string $userLogin Username @param string $password Password in clear text @param string $email @param string $alias @param array $optional @return bool|object @throws InvalidRequestException
entailment
public function updateUser($userLogin, $password = '', $email = '', $alias = '', array $optional = []) { return $this->_request('UsersManager.updateUser', [ 'userLogin' => $userLogin, 'password' => $password, 'email' => $email, 'alias' => $alias, ], $o...
Update a user @param string $userLogin Username @param string $password Password in clear text @param string $email @param string $alias @param array $optional @return bool|object @throws InvalidRequestException
entailment