protected function extractModelFields($namespace)
    {
        $payload = [];
        try {
            $reflector = new \ReflectionClass($namespace);
            // Checks if reflector is a subclass of propel ActiveRecords
            if (NULL !== $reflector && $reflector->isSubclassOf(self::MODEL_INTERFACE)) {
                $tableMap = $namespace::TABLE_MAP;
                $tableMap = $tableMap::getTableMap();
                /** @var ColumnMap $field */
                foreach ($tableMap->getColumns() as $field) {
                    list($type, $format) = DocumentorHelper::translateSwaggerFormats($field->getType());
                    $info = [
                        "required" => $field->isNotNull(),
                        'format' => $format,
                    ];
                    if(count($field->getValueSet())) {
                        $info['enum'] = array_values($field->getValueSet());
                    }
                    if(null !== $field->getDefaultValue()) {
                        $info['default'] = $field->getDefaultValue();
                    }
                    $payload[ApiHelper::getColumnMapName($field)] = $info;
                }
            } elseif (null !== $reflector && $reflector->isSubclassOf(self::DTO_INTERFACE)) {
                $payload = $this->extractDtoProperties($namespace);
            }
        } catch (\Exception $e) {
            Logger::log($e->getMessage(), LOG_ERR);
        }

        return $payload;
    }
protected function extractModelFields($namespace)
    {
        $payload = [];
        try {
            $reflector = new \ReflectionClass($namespace);
            // Checks if reflector is a subclass of propel ActiveRecords
            if (NULL !== $reflector && $reflector->isSubclassOf(self::MODEL_INTERFACE)) {
                $tableMap = $namespace::TABLE_MAP;
                $tableMap = $tableMap::getTableMap();
                /** @var ColumnMap $field */
                foreach ($tableMap->getColumns() as $field) {
                    list($type, $format) = DocumentorHelper::translateSwaggerFormats($field->getType());
                    $info = [
                        "required" => $field->isNotNull(),
                        'format' => $format,
                    ];
                    if(count($field->getValueSet())) {
                        $info['enum'] = array_values($field->getValueSet());
                    }
                    if(null !== $field->getDefaultValue()) {
                        $info['default'] = $field->getDefaultValue();
                    }
                    $payload[ApiHelper::getColumnMapName($field)] = $info;
                }
            } elseif (null !== $reflector && $reflector->isSubclassOf(self::DTO_INTERFACE)) {
                $payload = $this->extractDtoProperties($namespace);
            }
        } catch (\Exception $e) {
            Logger::log($e->getMessage(), LOG_ERR);
        }

        return $payload;
    }
protected function extractModelFields ( $ namespace ) { $ payload = [ ] ; try { $ reflector = new \ ReflectionClass ( $ namespace ) ; // Checks if reflector is a subclass of propel ActiveRecords if ( NULL !== $ reflector && $ reflector -> isSubclassOf ( self :: MODEL_INTERFACE ) ) { $ tableMap = $ namespace :: TABLE_MAP ; $ tableMap = $ tableMap :: getTableMap ( ) ; /** @var ColumnMap $field */ foreach ( $ tableMap -> getColumns ( ) as $ field ) { list ( $ type , $ format ) = DocumentorHelper :: translateSwaggerFormats ( $ field -> getType ( ) ) ; $ info = [ "required" => $ field -> isNotNull ( ) , 'format' => $ format , ] ; if ( count ( $ field -> getValueSet ( ) ) ) { $ info [ 'enum' ] = array_values ( $ field -> getValueSet ( ) ) ; } if ( null !== $ field -> getDefaultValue ( ) ) { $ info [ 'default' ] = $ field -> getDefaultValue ( ) ; } $ payload [ ApiHelper :: getColumnMapName ( $ field ) ] = $ info ; } } elseif ( null !== $ reflector && $ reflector -> isSubclassOf ( self :: DTO_INTERFACE ) ) { $ payload = $ this -> extractDtoProperties ( $ namespace ) ; } } catch ( \ Exception $ e ) { Logger :: log ( $ e -> getMessage ( ) , LOG_ERR ) ; } return $ payload ; }
Extract all fields from a ActiveResource model

@param string $namespace

@return mixed
Extract all fields from a ActiveResource model