/** * @param string $key * @param string $value */ protected function setValue($key, $value) { if (method_exists($this, 'castValue')) { $value = $this->castValue($value); } set_value($key, $value, $this->values, $this->changedValues); if (property_exists($this, 'objects')) { unset_value($key, $this->objects); } }
/** * @param string $key * @param object[] $objects */ protected function setObjects($key, $objects) { if (null === $objects) { unset_value($key, $this->values, $this->changedValues); unset_value($key, $this->objects); } else { set_value($key, [], $this->values, $this->changedValues); set_value($key, [], $this->objects); } if ($objects) { foreach ($objects as $objectKey => $object) { $this->addObject($key, $object, $objectKey); } } }