Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns the number of arguments passed to the function
<?php func_num_args(): int
<?php public function meta($key = null)
{
if (func_num_args() === 1) {
return $this->metaValue($key);
}
<?php public function files($folder = '/', $recursive = false)
{
if (func_num_args() === 0) {
$recursive = true;
}
<?php public function folders($folder = '/', $recursive = false)
{
if (func_num_args() === 0) {
$recursive = true;
}
<?php {
$query = $this->queryAssets();
if (func_num_args() === 0) {
$recursive = true;
}
<?php public function assetFolders($folder = '/', $recursive = false)
{
if (func_num_args() === 0) {
$recursive = true;
}
<?php public function data($data = null)
{
if (func_num_args() === 0) {
$data = array_merge($this->model()->attributesToArray(), [
'roles' => $this->roles()->map->handle()->values()->all(),
'groups' => $this->groups()->map->handle()->values()->all(),
<?php public function id($id = null)
{
if (func_num_args() === 0) {
return $this->model()->getKey();
}
<?php public function handle(string $handle = null)
{
if (func_num_args() === 0) {
return $this->handle;
}
<?php public function data($data = null)
{
if (func_num_args() === 0) {
return $this->traitData();
}
<?php public function value(string $value = null)
{
if (func_num_args() > 0) {
$this->value = $value;
return $this;
<?php public function label(string $label = null)
{
if (func_num_args() > 0) {
$this->label = $label;
return $this;
<?php {
throw_if($this->pendingGroup, new \Exception('Cannot double nest permission groups'));
if (func_num_args() === 3) {
$this->groups[$name] = $label;
}
<?php $this->groups[$name] = $label;
}
if (func_num_args() === 2) {
$permissions = $label;
}
<?php public function title(string $title = null)
{
if (func_num_args() === 0) {
return $this->title;
}
<?php public function roles($roles = null)
{
if (func_num_args() === 0) {
return $this->roles;
}