Lines Matching refs:source
41 public function __construct(string $opType = self::OP_TYPE_INDEX, array $metadata = [], array $source = [])
45 $this->setSource($source);
53 $source = $this->getSource();
54 if (\is_string($source)) {
55 $string .= $source;
56 } elseif (\is_array($source) && \array_key_exists('doc', $source) && \is_string($source['doc'])) {
57 if (isset($source['doc_as_upsert'])) {
58 $docAsUpsert = ', "doc_as_upsert": '.($source['doc_as_upsert'] ? 'true' : 'false');
62 $string .= '{"doc": '.$source['doc'].$docAsUpsert.'}';
64 $string .= JSON::stringify($source, \JSON_UNESCAPED_UNICODE);
108 * @param array|string $source
112 public function setSource($source): self
114 $this->_source = $source;