$owner
$owner : string
The strict, global path to the class which owns this property.
Examples: \MyNamespace\MyClass
or \MyGlobalClass
.
Provides a human-readable description of a compiled PropertyDefinition.
NOTE:
The class validates all parameters, but provides public properties to
avoid needless function calls. It's therefore your responsibility to never
assign any bad values to the public properties after this object's creation!
$is_defined : boolean
Whether this property is defined in the class property map.
Properties are only reliable when defined within the class map. Because undefined properties will be inaccessible as soon as they are missing from the data, whereas class properties are always accessible.
Is TRUE
if the property is defined in the class map, otherwise FALSE
if this property only exists within the current class instance's data.
$is_basic_type : boolean
Whether the type is a basic PHP type.
Basic types are mixed
, int
, float
, string
or bool
.
Note that mixed
is simply an alias for "allow any of the basic types,
as well as arrays of those basic types" (although it's worth noting that
mixed[]
for example would enforce a depth of 1 with no deeper arrays).
Is TRUE
if basic type, or FALSE
if object type.
$is_relative_type_path : boolean
Whether the type is a relative class path (relative to owner class).
Examples: Imagine that the $owner
is \Foo\Bar
, and the $type
is
\Foo\Xyz
. In that case, the type is not a relative path. However, if
the type had been Xyz
, it would be marked as relative here.
This is always FALSE
for basic types. And is only TRUE
for object
types if the path is actually relative. That's only possible when the
target class type lives within the same namespace as the owner.
__construct(string $ownerClassName, string $propName, \LazyJsonMapper\Property\PropertyDefinition $propDef, boolean $allowRelativeTypePath = false)
Constructor.
string | $ownerClassName | The full path of the
class that owns this
property, but without
any leading |
string | $propName | The JSON property name. |
\LazyJsonMapper\Property\PropertyDefinition | $propDef | Compiled definition of the property. |
boolean | $allowRelativeTypePath | If |
If there are any problems with the input.