Get an associative array of all of the serialisable properties defined on this class.
968320
public function __getSerialisablePropertyMap() {
        $propertyAccessors = $this->__findSerialisablePropertyAccessors();
        $propertyMap = array();
        foreach ($propertyAccessors as $accessorSet) {

            // If a get accessor exists, add it to the map
            if (isset ($accessorSet ["get"])) {
                $accessor = $accessorSet ["get"];
                if ($accessor instanceof \ReflectionMethod) {

                    // Check that this is not qualified with a @no-serialise tag
                    if (strpos($accessor->getDocComment(), "@no-serialise"))
                        continue;

                    $propertyName = substr($accessor->getName(), 3);
                    $propertyName = CodeUtils::instance()->normalisePropertyName($propertyName);
                    if ($accessor->isPublic())
                        $propertyMap [$propertyName] = $accessor->invoke($this);
                    else if ($accessor->isProtected()) {
                        $methodName = "get" . $propertyName;
                        $propertyMap [$propertyName] = $this->$methodName ();
                    }
                } else if ($accessor instanceof \ReflectionProperty) {

                    if (strpos($accessor->getDocComment(), "@no-serialise"))
                        continue;


                    $propertyName = $accessor->getName();
                    if ($accessor->isPublic())
                        $propertyMap [$propertyName] = $accessor->getValue($this);
                    else if ($accessor->isProtected()) {
                        $propertyName = $accessor->getName();
                        $propertyMap [$propertyName] = $this->$propertyName;
                    }
                }
            }

        }

        return $propertyMap;

    }
268859
def serialisable(cls, key, obj):
        '''
        '''
        # ignore class method names
        if key.startswith('_Serialisable'.format(cls.__name__)):
            return False
        if key in obj.__whitelist:
            return True
        # class variables will be prefixed with '_<cls.__name__>__variable'
        # so let's remove these too
        #if key.startswith('__'):
        if '__' in key:
            return False
        # ignore our own class variables
        #if key in ['_Serialisable__whitelist', '_Serialisable__blacklist']:
        #    return False
        if key in obj.__blacklist:
            return False
        if callable(getattr(obj, key)):
            return False
        # check for properties
        if hasattr(obj.__class__, key):
            if isinstance(getattr(obj.__class__, key), property):
                return False
        return True
475029
private VarSymbol getDefinedSerializableFields(ClassSymbol def) {
        Names names = def.name.table.names;

        /* SERIALIZABLE_FIELDS can be private,
         * so must lookup by ClassSymbol, not by ClassDocImpl.
         */
        for (Scope.Entry e = def.members().lookup(names.fromString(SERIALIZABLE_FIELDS)); e.scope != null; e = e.next()) {
            if (e.sym.kind == Kinds.VAR) {
                VarSymbol f = (VarSymbol)e.sym;
                if ((f.flags() & Flags.STATIC) != 0 &&
                    (f.flags() & Flags.PRIVATE) != 0) {
                    return f;
                }
            }
        }
        return null;
    }
263590
protected function getGeneratedProperties(): array
    {
        $reflectionObject = new \ReflectionObject($this);
        $properties = $reflectionObject->getProperties(\ReflectionProperty::IS_PUBLIC);
        $result = [];
        foreach ($properties as $property) {
            if (!$property->isPublic() || @$property->isDefault()) {
                continue;
            }

            $result[] = $property;
        }

        return $result;
    }
711262
private function toArray()
    {
        $data = [];

        $reflection = new ReflectionClass($this);

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);
            $data[$property->getName()] = $property->getValue($this);
        }

        return $data;
    }
1176474
public function __findSerialisablePropertyAccessors() {

        // Grab the class name first.
        $className = get_class($this);

        // If no accessor map has been previously cached for this class type, cache it now.
        if (!isset (self::$__accessorMaps [$className])) {


            $reflectionClass = new \ReflectionClass ($className);

            // Create the accessors array for storing all possible accessors.
            $accessors = array();

            // Loop through all methods, checking for public get and set accessors first.
            $methods = $reflectionClass->getMethods();
            foreach ($methods as $method) {

                if ($method->isStatic())
                    continue;

                if ((substr($method->getName(), 0, 3) == "get") && ($method->getNumberOfRequiredParameters() == 0)) {
                    $propertyName = strtolower(substr($method->getName(), 3));
                    if (!isset ($accessors [$propertyName])) {
                        $accessors [$propertyName] = array();
                    }
                    $accessors [$propertyName] ["get"] = $method;
                } else if (substr($method->getName(), 0, 3) == "set") {
                    $propertyName = strtolower(substr($method->getName(), 3));
                    if (!isset ($accessors [$propertyName])) {
                        $accessors [$propertyName] = array();
                    }
                    $accessors [$propertyName] ["set"] = $method;
                }
            }

            // Now loop through all properties, checking for any public / protected ones
            $properties = $reflectionClass->getProperties();
            foreach ($properties as $property) {

                if ($property->isStatic())
                    continue;

                $propertyName = strtolower($property->getName());

                if (!isset ($accessors [$propertyName])) {
                    $accessors [$propertyName] = array();
                }
                if (!isset ($accessors [$propertyName] ["get"]))
                    $accessors [$propertyName] ["get"] = $property;
                if (!isset ($accessors [$propertyName] ["set"]))
                    $accessors [$propertyName] ["set"] = $property;

            }

            self::$__accessorMaps [$className] = $accessors;

        }

        return self::$__accessorMaps [$className];
    }
961195
public function getStaticProperties()
    {
        // In runtime static properties can be changed in any time
        if ($this->isInitialized()) {
            return parent::getStaticProperties();
        }

        $properties = [];

        $reflectionProperties = $this->getProperties(ReflectionProperty::IS_STATIC);
        foreach ($reflectionProperties as $reflectionProperty) {
            if (!$reflectionProperty instanceof ReflectionProperty) {
                if (!$reflectionProperty->isPublic()) {
                    $reflectionProperty->setAccessible(true);
                }
            }
            $properties[$reflectionProperty->getName()] = $reflectionProperty->getValue();
        }

        return $properties;
    }
1051864
protected function getManagedProperties(): array
    {
        $properties = $this->entityMap->getProperties();

        $attributesName = $this->entityMap->getAttributesArrayName();

        return $attributesName == null ? $properties : array_merge($properties, [$attributesName]);
    }
504983
public function toArray() {

		$class = new \ReflectionClass($this);
		$props = $class -> getProperties();
		$data  = [];

		foreach($props as $prop) {

			if($class -> name === $prop -> class) {

				if(true === isset($this -> {$prop -> name})) {
					$data[$prop -> name] = $this -> {$prop -> name};
				}
			}
		}

		foreach($this -> columns as $column) {
			$data[key($column)] = $column[key($column)];
		}

		return $data;
	}
850925
public static function serialize(array $values): array
    {
        $serializedData = [];

        foreach ($values as $property => $value) {
            if (is_array($value)) {
                $value = self::serialize($value);
            }

            if ($value instanceof Serializable) {
                $value = $value->serialize();
            }

            $serializedData[$property] = $value;
        }

        return $serializedData;
    }
413486
public function jsonSerialize()
    {
        $properties = get_object_vars($this);
        $outProperties = array();
        foreach ($properties as $propertie => $value) {
            if ($propertie[0] === '_') {
                $namePropertie = substr($propertie, 1);
                $outProperties[$namePropertie] = $this->$propertie;
            } else {
                $outProperties[$propertie] = $this->$propertie;
            }
        }

        return $outProperties;
    }
203825
public function toArray()
    {
        $data = parent::toArray();

        foreach ($this->getComputedProperties() as $property)
        {
            if ($this->{$property} instanceof ModelEntityInterface) {
                $data[$property] = array_values($this->{$property}->toArray());
            } else {
                $data[$property] = $this->{$property};
            }
        }

        foreach(array_keys($data) as $key)
        {
            if (substr($key, 0, 1) === '_') {
                unset($data[$key]);
            }
        }

        return $data;
    }
224129
public function serialize() {
		$attributes = array();

		if ( $this->visible ) {
			// If visible attributes are set, we'll only reveal those.
			foreach ( $this->visible as $key ) {
				$attributes[ $key ] = $this->get_attribute( $key );
			}
		} elseif ( $this->hidden ) {
			// If hidden attributes are set, we'll grab everything and hide those.
			foreach ( $this->get_attribute_keys() as $key ) {
				if ( ! in_array( $key, $this->hidden ) ) {
					$attributes[ $key ] = $this->get_attribute( $key );
				}
			}
		} else {
			// If nothing is hidden/visible, we'll grab and reveal everything.
			foreach ( $this->get_attribute_keys() as $key ) {
				$attributes[ $key ] = $this->get_attribute( $key );
			}
		}

		return array_map( function ( $attribute ) {
			if ( $attribute instanceof Serializes ) {
				return $attribute->serialize();
			}

			return $attribute;
		}, $attributes );
	}
60911
public function serialize()
    {
        $result = array();
        foreach ($this->getKeys() as $k => $v) {
            $result[] = $k . ': ' . $v;
        }
        foreach ($this->getVariables() as $k => $v) {
            if (is_array($v)) {
                foreach ($v as $singleValue) {
                    $result[] = $this->serializeVariable($k, $singleValue);
                }
            } else {
                $result[] = $this->serializeVariable($k, $v);
            }
        }
        $mStr = $this->finishMessage(implode(self::EOL, $result));
        return $mStr;
    }
81244
public function buildProperties()
    {
        $methods            = get_class_methods($this);
        $properties         = get_object_vars($this);
        $filteredProperties = array();

        // only properties that have getters should be extracted
        foreach ($properties as $property => $value) {
            $getter = 'get' . $this->camelize($property, true);
            if (in_array($getter, $methods)) {
                $filteredProperties[$property] = $this->{$getter}();
            }
        }

        return $filteredProperties;
    }
645457
public function getPropertiesAsArray()
    {
        $array = array();

        foreach ($this->getProperties() as $property) {
            $array[$property->getName()] = [ 'value' => $property->getValue(), 'type' => $property->getType() ];
        }

        return $array;
    }
784793
protected static List<PropertyDescriptor> getWriteableProperties(Class cls)
        {
        BeanWrapper beanWrapper = new BeanWrapperImpl(cls);
        List<PropertyDescriptor> writeableProperties =
                new ArrayList<PropertyDescriptor>();
        PropertyDescriptor[] props = beanWrapper.getPropertyDescriptors();
        for (PropertyDescriptor prop : props)
            {
            if (isWriteable(prop))
                {
                writeableProperties.add(prop);
                }
            }
        return writeableProperties;
        }