Back to Joomla project (class list)

Class OnGetApiFields - list of methods

Event for getting extra API Fields and Relations to render with an entity

Extends

Package: Joomla\CMS\MVC\View\Event
Copyright: (C) 2020 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/MVC/View/Event/OnGetApiFields.php
Project: Joomla

Method Summary

public
(mixed $name, array $arguments = array())

Constructor.
Parameters
  • string $name The event name.
  • array $arguments The event arguments.
-
  • \BadMethodCallException
Show source code of this method: __construct Source Code

protected mixed
(mixed $value)

Setter for the type argument
Parameters
  • int $value The constant from VIEW_TYPE
Returns
  • mixed
-
  • \BadMethodCallException if the argument is not of the expected type
Show source code of this method: setType Source Code

protected array
(mixed $value)

Setter for the fields argument
Parameters
  • mixed $value The value to set
Returns
  • array
-
  • \BadMethodCallException if the argument is not a non-empty array
Show source code of this method: setFields Source Code

protected array
(mixed $value)

Setter for the relations argument
Parameters
  • mixed $value The value to set
Returns
  • array
-
  • \BadMethodCallException if the argument is not a non-empty array
Show source code of this method: setRelations Source Code

public void
(array $fields)

Allows the user to add names of properties that will be interpreted as relations Note that if there is an existing data property it will also be displayed as well as the relation due to the internal implementation (this behaviour is not part of this API however and should not be guaranteed)
Parameters
  • string[] $fields The array of additional fields to add to the data of the attribute
Returns
  • void
Show source code of this method: addFields Source Code

public void
(array $fields)

Allows the user to add names of properties that will be interpreted as relations Note that if there is an existing data property it will also be displayed as well as the relation due to the internal implementation (this behaviour is not part of this API however and should not be guaranteed)
Parameters
  • string[] $fields The array of additional fields to add as relations
Returns
  • void
Show source code of this method: addRelations Source Code

public array
()

Get properties to render.
Returns
  • array
Show source code of this method: getAllPropertiesToRender Source Code

public array
()

Get properties to render.
Returns
  • array
Show source code of this method: getAllRelationsToRender Source Code

Properties Summary

private string[]
$extraRelations
List of names of properties that will be rendered as relations
Since
  • 4.0.0
private string[]
$extraAttributes
List of names of properties that will be rendered as data
Since
  • 4.0.0

Constants Summary

public
$LIST
List of types of view supported
Since
  • 4.0.0
public
$ITEM
List of types of view supported
Since
  • 4.0.0

Tags Summary

Since
4.0.0