src/WithArrayTransform.php
public function toArray()
    {
        $classData = [];
        foreach ($this->getReflector()->getProperties(\ReflectionProperty::IS_PROTECTED) as $reflectionProperty) {
            if (!$reflectionProperty->isStatic()) {
                $reflectionProperty->setAccessible(true);
                $classData[$reflectionProperty->getName()] = $reflectionProperty->getValue($this);
            }
        }
        return $classData;
    }
public function toArray()
    {
        $classData = [];
        foreach ($this->getReflector()->getProperties(\ReflectionProperty::IS_PROTECTED) as $reflectionProperty) {
            if (!$reflectionProperty->isStatic()) {
                $reflectionProperty->setAccessible(true);
                $classData[$reflectionProperty->getName()] = $reflectionProperty->getValue($this);
            }
        }
        return $classData;
    }
public function toArray ( ) { $ classData = [ ] ; foreach ( $ this -> getReflector ( ) -> getProperties ( \ ReflectionProperty :: IS_PROTECTED ) as $ reflectionProperty ) { if ( ! $ reflectionProperty -> isStatic ( ) ) { $ reflectionProperty -> setAccessible ( true ) ; $ classData [ $ reflectionProperty -> getName ( ) ] = $ reflectionProperty -> getValue ( $ this ) ; } } return $ classData ; }
Fetch the array representation of the protected properties of an object.
@return array
Fetch the array representation of the protected properties of an object .