src/WithArrayTransform.php
public function fromArray(array $source)
    {
        foreach ($this->getReflector()->getProperties(\ReflectionProperty::IS_PROTECTED) as $reflectionProperty) {
            if (!$reflectionProperty->isStatic() && isset($source[$reflectionProperty->getName()])) {
                $reflectionProperty->setAccessible(true);
                $reflectionProperty->setValue($this, $source[$reflectionProperty->getName()]);
            }
        }
        return $this;
    }
public function fromArray(array $source)
    {
        foreach ($this->getReflector()->getProperties(\ReflectionProperty::IS_PROTECTED) as $reflectionProperty) {
            if (!$reflectionProperty->isStatic() && isset($source[$reflectionProperty->getName()])) {
                $reflectionProperty->setAccessible(true);
                $reflectionProperty->setValue($this, $source[$reflectionProperty->getName()]);
            }
        }
        return $this;
    }
public function fromArray ( array $ source ) { foreach ( $ this -> getReflector ( ) -> getProperties ( \ ReflectionProperty :: IS_PROTECTED ) as $ reflectionProperty ) { if ( ! $ reflectionProperty -> isStatic ( ) && isset ( $ source [ $ reflectionProperty -> getName ( ) ] ) ) { $ reflectionProperty -> setAccessible ( true ) ; $ reflectionProperty -> setValue ( $ this , $ source [ $ reflectionProperty -> getName ( ) ] ) ; } } return $ this ; }
Set protected propertie according to provided source.
@param array source data.
@return $this
Set protected propertie according to provided source .