Back to OnGetApiFields class

Method addRelations

public void
addRelations
(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

Method addRelations - Source code

/**
 * 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)
 *
 * @param   string[]  $fields  The array of additional fields to add as relations
 *
 * @return  void
 */
public function addRelations(array $fields) : void
{
    $this->extraRelations = array_merge($this->extraRelations, $fields);
}