public function serialize($includePrivate=false, $includeInternal=true, $removeNullValues=false,
                              $dateAsISO8601=false)
    {
        $answer = array();
        $schema = $this->_jsonSchema;

        foreach ($schema['definition'] as $property => $definition) {
            $method = 'get' . ucfirst($property);

            //Checking special types
            if ($definition['private'] == true && !$includePrivate) {
                continue;
            }

            if ($definition['internal'] == true && !$includeInternal) {
                continue;
            }

            $valueFromMethod = $this->$method();

            if (isset($definition['type'])) {
                switch ($definition['type']) {
                    case "datetime":
                        if ($dateAsISO8601 && !is_null($valueFromMethod)) {
                            $valueFromMethod = $valueFromMethod->format("c");
                        } else {
                            $valueFromMethod = $this->$property; //Integer value
                        }
                        break;
                }
            }
            $value = StoreHelper::serialize($valueFromMethod, $includePrivate, $includeInternal, $removeNullValues, $dateAsISO8601);

            if (is_null($value)
                && $removeNullValues
                && array_key_exists('validationConstraints', $definition)
                && !$definition['keepIfNull']
                && !(in_array('NotBlank', $definition['validationConstraints']))) {

                continue;
            }

            $answer[$property] = $value;

            /**
             * Add aliases
             */
            if ($definition['alias']) {
                $alias = $definition['alias'];
                $method = 'get' . ucfirst($alias);
                if (method_exists($this, $method)) {
                    $answer[$alias] = $this->$method();
                } else {
                    $answer[$alias] = $answer[$property];
                }
            }
        }

        return (object) $answer;
    }