/** * Sets the default string format for ActiveRecord objects in this table. * * Any of 'XML', 'YAML', 'JSON', or 'CSV'. * * @param string $format * @throws InvalidArgumentException */ public function setDefaultStringFormat($format) { $formats = Database::getSupportedStringFormats(); $format = strtoupper($format); if (!in_array($format, $formats)) { throw new InvalidArgumentException(sprintf('Given "%s" default string format is not supported. Only "%s" are valid string formats.', $format, implode(', ', $formats))); } $this->defaultStringFormat = $format; }