Nette\Utils\ObjectMixin::getMagicProperty PHP Method

getMagicProperty() public static method

public static getMagicProperty ( $class, $name )
    public static function getMagicProperty($class, $name)
    {
        $props = self::getMagicProperties($class);
        return isset($props[$name]) ? $props[$name] : NULL;
    }

Usage Example

 public function hasProperty(ClassReflection $classReflection, string $propertyName) : bool
 {
     $traitNames = $this->getTraitNames($classReflection->getNativeReflection());
     if (!in_array(\Nette\SmartObject::class, $traitNames, true)) {
         return false;
     }
     $property = \Nette\Utils\ObjectMixin::getMagicProperty($classReflection->getName(), $propertyName);
     if ($property === null) {
         return false;
     }
     $getterMethod = $this->getMethodByProperty($classReflection, $propertyName);
     if ($getterMethod === null) {
         return false;
     }
     return $getterMethod->isPublic();
 }
All Usage Examples Of Nette\Utils\ObjectMixin::getMagicProperty