Oihana PHP Arango

matchesSkin.php

Table of Contents

Functions

matchesSkin()  : bool
Tests whether a `Field::SKINS` marker matches the active request skin.

Functions

matchesSkin()

Tests whether a `Field::SKINS` marker matches the active request skin.

matchesSkin(mixed $skins, string|null $currentSkin) : bool

Used internally by the AQL projection layer (FieldsTrait::filterFieldsBySkin) to decide whether a field declared with Field::SKINS => [...] should be projected for the current ?skin= query parameter.

Accepted shapes for $skins :

  • null — no skin restriction declared, always matches
  • array<string> — list of skins that activate the field, e.g. [ Skin::DEFAULT , Skin::FULL ]
  • string — comma-separated list, e.g. "main,full"

String comparisons are strict and trimmed of surrounding whitespace.

Parameters
$skins : mixed

The Field::SKINS value from the field definition.

$currentSkin : string|null

The active request skin, or null when no skin is set.

Tags
author

Marc Alcaraz

Return values
bool —

true if the field must be kept in the projection, false to drop it.

On this page

Search results