Back to BeforePublishEvent class

Method setQuery

protected mixed
setQuery
(mixed $value)
Setter for the pks argument
Parameters
  • array|null $value The value to set
Returns
  • mixed
-
  • \BadMethodCallException if the argument is not of the expected type

Method setQuery - Source code

/**
 * Setter for the pks argument
 *
 * @param   array|null  $value  The value to set
 *
 * @return  mixed
 *
 * @throws  BadMethodCallException  if the argument is not of the expected type
 */
protected function setQuery($value)
{
    if (!empty($value) && !\is_array($value)) {
        throw new BadMethodCallException("Argument 'pks' of event {$this->name} must be empty or an array");
    }
    return $value;
}