SearchKit - Pick better default for aggregate functions
[civicrm-core.git] / Civi / Api4 / Query / SqlFunctionREPLACE.php
CommitLineData
e7f6def6
CW
1<?php
2/*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12namespace Civi\Api4\Query;
13
14/**
15 * Sql function
16 */
17class SqlFunctionREPLACE extends SqlFunction {
18
19 protected static $category = self::CATEGORY_STRING;
20
d3be4a16
CW
21 protected static $dataType = 'String';
22
f19a0f00
CW
23 protected static function params(): array {
24 return [
25 [
9e9feedf
CW
26 'optional' => FALSE,
27 'must_be' => ['SqlField', 'SqlString'],
28 'label' => ts('Source'),
29 ],
30 [
31 'optional' => FALSE,
32 'must_be' => ['SqlString', 'SqlField'],
33 'label' => ts('Find'),
34 ],
35 [
f19a0f00 36 'optional' => FALSE,
1fe4682d 37 'must_be' => ['SqlString', 'SqlField'],
9e9feedf 38 'label' => ts('Replace'),
f19a0f00
CW
39 ],
40 ];
41 }
e7f6def6 42
9cae8a07
CW
43 /**
44 * @return string
45 */
46 public static function getTitle(): string {
1fe4682d
CW
47 return ts('Replace text');
48 }
49
50 /**
51 * @return string
52 */
53 public static function getDescription(): string {
54 return ts('Substitutes one value for another in the text.');
9cae8a07
CW
55 }
56
e7f6def6 57}