src/Utilities/Reflection.php
private static function getPropertyValueByPropertiesChain($source, $property, $force)
    {
        $exploded = explode('.', $property);

        $property = $exploded[0];
        $source = self::getPropertyValue($source, $property, $force);

        /*
         * Value of processed property from the chain is not null?
         * Let's dig more and get proper value
         *
         * Required to avoid bug:
         * \ReflectionObject::__construct() expects parameter 1 to be object, null given
         * (...)
         * 4. at \ReflectionObject->__construct (null)
         * 5. at Reflection ::getPropertyValue (null, 'name', true)
         * 6. at ListService->getItemValue (object(Deal), 'project.name', '0')
         *
         * while using "project.name" as property - $project has $name property ($project exists in the Deal class)
         * and the $project equals null
         *
         * Meritoo <github@meritoo.pl>
         * 2016-11-07
         */
        if (null !== $source) {
            unset($exploded[0]);
            $property = implode('.', $exploded);

            return self::getPropertyValue($source, $property, $force);
        }

        return null;
    }
private static function getPropertyValueByPropertiesChain($source, $property, $force)
    {
        $exploded = explode('.', $property);

        $property = $exploded[0];
        $source = self::getPropertyValue($source, $property, $force);

        /*
         * Value of processed property from the chain is not null?
         * Let's dig more and get proper value
         *
         * Required to avoid bug:
         * \ReflectionObject::__construct() expects parameter 1 to be object, null given
         * (...)
         * 4. at \ReflectionObject->__construct (null)
         * 5. at Reflection ::getPropertyValue (null, 'name', true)
         * 6. at ListService->getItemValue (object(Deal), 'project.name', '0')
         *
         * while using "project.name" as property - $project has $name property ($project exists in the Deal class)
         * and the $project equals null
         *
         * Meritoo <github@meritoo.pl>
         * 2016-11-07
         */
        if (null !== $source) {
            unset($exploded[0]);
            $property = implode('.', $exploded);

            return self::getPropertyValue($source, $property, $force);
        }

        return null;
    }
private static function getPropertyValueByPropertiesChain ( $ source , $ property , $ force ) { $ exploded = explode ( '.' , $ property ) ; $ property = $ exploded [ 0 ] ; $ source = self :: getPropertyValue ( $ source , $ property , $ force ) ; /*
         * Value of processed property from the chain is not null?
         * Let's dig more and get proper value
         *
         * Required to avoid bug:
         * \ReflectionObject::__construct() expects parameter 1 to be object, null given
         * (...)
         * 4. at \ReflectionObject->__construct (null)
         * 5. at Reflection ::getPropertyValue (null, 'name', true)
         * 6. at ListService->getItemValue (object(Deal), 'project.name', '0')
         *
         * while using "project.name" as property - $project has $name property ($project exists in the Deal class)
         * and the $project equals null
         *
         * Meritoo <github@meritoo.pl>
         * 2016-11-07
         */ if ( null !== $ source ) { unset ( $ exploded [ 0 ] ) ; $ property = implode ( '.' , $ exploded ) ; return self :: getPropertyValue ( $ source , $ property , $ force ) ; } return null ; }
Returns value of given property represented as chain of properties

@param mixed  $source   Object that should contains given property
@param string $property Dot-separated properties, e.g. "invoice.user.email"
@param bool   $force    (optional) If is set to true, try to retrieve value even if the object doesn't have
property. Otherwise - not.
@return mixed
Returns value of given property represented as chain of properties