Lines Matching full:script
3 namespace Elastica\Script;
9 * Base class for Script object.
36 * @param string|null $lang Script language, see constants
37 …* @param string|null $documentId Document ID the script action should be performed on (only releva…
55 * Factory to create a script object from data structure (reverse toArray).
61 * @return Script|ScriptId|self
74 $class = self::class === static::class ? Script::class : static::class;
79 throw new InvalidException('Failed to create script. Invalid data passed.');
109 return ['script' => $array];
113 * Returns an array with the script type as key and the script content as value.
119 $params = $data['script']['params'] ?? [];
120 $lang = $data['script']['lang'] ?? null;
123 throw new InvalidException('Script params must be an array');
126 if (isset($data['script']['source'])) {
127 return new Script(
128 $data['script']['source'],
134 if (isset($data['script']['id'])) {
136 $data['script']['id'],
142 throw new InvalidException('Failed to create script. Invalid data passed.');