public function setProperty($property, $value)
    {

        $this->$property = $value;


        // Parse $value. Is it an entity or an array containing entities?

        // We've got an array, lets see if we can instantiate an entity
        if(is_array($value) && !empty($value) && is_object(head($value))) {

            $array = $value; // for clarity, call it what it is

            // We can only guess at what the entity might be if we have the `type`
            if(property_exists(head($array), 'type')) {

                // Get the class of the new entity we want to instantiate
                $class = (new \ReflectionClass($this))->getNamespaceName() . "\\" . ucfirst(head($array)->type);

                // Update each element of the array to have the instantiated entity
                if(class_exists($class)) foreach($array as $key => $value) {

                    // Update the array with the entity
                    $array[$key] = new $class($value);

                }

                // Update the property with the array of entities
                $this->$property = $array;

            }

        }

        // We've got an object, see if we can instantiate that into an entity
        else if(gettype($value) == "object") {

            if(property_exists($value, 'type')) {

                // Get the class of the new entity we want to instantiate
                $class = (new \ReflectionClass($this))->getNamespaceName() . "\\" . ucfirst($value->type);

                // Update the property with the instantiated entity
                if(class_exists($class)) {
                    $this->$property = new $class($value);
                }

            }
        }

    }