final protected function _getPropertyDefinition(
        $propName,
        $allowUndefined = true)
    {
        if (isset($this->_compiledPropertyMapLink[$propName])) {
            // Custom class property definition exists, so use that. Properties
            // defined in the class map are always valid even if not in data!
            return $this->_compiledPropertyMapLink[$propName];
        } elseif ($allowUndefined && array_key_exists($propName, $this->_objectData)) {
            // No property definition exists, but the property exists in the
            // object instance's data, so treat it as undefined & untyped.
            return UndefinedProperty::getInstance();
        } else {
            // There is no definition & no object instance data (or disallowed)!
            throw new LazyJsonMapperException(sprintf(
                'No such object property "%s".',
                $propName
            ));
        }
    }
final protected function _getPropertyDefinition(
        $propName,
        $allowUndefined = true)
    {
        if (isset($this->_compiledPropertyMapLink[$propName])) {
            // Custom class property definition exists, so use that. Properties
            // defined in the class map are always valid even if not in data!
            return $this->_compiledPropertyMapLink[$propName];
        } elseif ($allowUndefined && array_key_exists($propName, $this->_objectData)) {
            // No property definition exists, but the property exists in the
            // object instance's data, so treat it as undefined & untyped.
            return UndefinedProperty::getInstance();
        } else {
            // There is no definition & no object instance data (or disallowed)!
            throw new LazyJsonMapperException(sprintf(
                'No such object property "%s".',
                $propName
            ));
        }
    }
final protected function _getPropertyDefinition ( $ propName , $ allowUndefined = true ) { if ( isset ( $ this -> _compiledPropertyMapLink [ $ propName ] ) ) { // Custom class property definition exists, so use that. Properties // defined in the class map are always valid even if not in data! return $ this -> _compiledPropertyMapLink [ $ propName ] ; } elseif ( $ allowUndefined && array_key_exists ( $ propName , $ this -> _objectData ) ) { // No property definition exists, but the property exists in the // object instance's data, so treat it as undefined & untyped. return UndefinedProperty :: getInstance ( ) ; } else { // There is no definition & no object instance data (or disallowed)! throw new LazyJsonMapperException ( sprintf ( 'No such object property "%s".' , $ propName ) ) ; } }
Get the property definition for an object data property.

If the property doesn't exist in the class definition but exists in the
object instance's data, then it will be treated as an undefined & untyped
property. This ensures that the user can access undefined properties too!

However, you should always strive to keep your classes up-to-date so that
all properties are defined, otherwise they'll be totally inaccessible
(instead of returning `NULL`) anytime they're missing from the JSON data.

@param string $propName       The property name.
@param bool   $allowUndefined Whether to allow default definitions when
the property exists in the data but not in
our actual class property map.

@throws LazyJsonMapperException If property isn't defined in the class
map and also doesn't exist in the object
instance's data. Note that if undefined
definitions are disallowed, we will ONLY
check in the class definition map.

@return PropertyDefinition An object describing the property.
Get the property definition for an object data property .