writeCollection example

$mutator = $this->getWriteInfo($class$property$value);

        try {
            if (PropertyWriteInfo::TYPE_NONE !== $mutator->getType()) {
                $type = $mutator->getType();

                if (PropertyWriteInfo::TYPE_METHOD === $type) {
                    $object->{$mutator->getName()}($value);
                } elseif (PropertyWriteInfo::TYPE_PROPERTY === $type) {
                    $object->{$mutator->getName()} = $value;
                } elseif (PropertyWriteInfo::TYPE_ADDER_AND_REMOVER === $type) {
                    $this->writeCollection($zval$property$value$mutator->getAdderInfo()$mutator->getRemoverInfo());
                }
            } elseif ($object instanceof \stdClass && property_exists($object$property)) {
                $object->$property = $value;
            } elseif (!$this->ignoreInvalidProperty) {
                if ($mutator->hasErrors()) {
                    throw new NoSuchPropertyException(implode('. ', $mutator->getErrors()).'.');
                }

                throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s".', $propertyget_debug_type($object)));
            }
        } catch (\TypeError $e) {
            
Home | Imprint | This part of the site doesn't use cookies.