Lines Matching refs:key
53 public function __get(string $key) argument
55 return $this->get($key);
61 public function __set(string $key, $value): void argument
63 $this->set($key, $value);
66 public function __isset(string $key): bool argument
68 return $this->has($key) && null !== $this->get($key);
71 public function __unset(string $key): void argument
73 $this->remove($key);
79 * @param mixed $key
85 public function get($key) argument
87 if (!$this->has($key)) {
88 throw new InvalidException("Field {$key} does not exist");
91 return $this->_data[$key];
101 public function set(string $key, $value): self argument
106 $this->_data[$key] = $value;
114 public function has(string $key): bool argument
116 return \is_array($this->_data) && \array_key_exists($key, $this->_data);
124 public function remove(string $key): self argument
126 if (!$this->has($key)) {
127 throw new InvalidException("Field {$key} does not exist");
129 unset($this->_data[$key]);
145 * @param string $key Key to add the file to
149 public function addFile(string $key, string $filepath, string $mimeType = ''): self argument
157 $this->set($key, $value);
165 public function addFileContent(string $key, string $content): self argument
167 return $this->set($key, \base64_encode($content));
173 * @param string $key Field key
177 public function addGeoPoint(string $key, float $latitude, float $longitude): self argument
181 $this->set($key, $value);