src/FreeFW/Storage/PDOStorage.php
protected function renderModelField(string $p_field)
    {
        $parts = explode('.', $p_field);
        $class = $parts[0];
        $field = $parts[1];
        if (!array_key_exists($class, self::$models)) {
            self::$models[$class] = \FreeFW\DI\DI::get($class);
        }
        $model      = self::$models[$class];
        $source     = $model::getSource();
        $properties = $model::getProperties();
        $type       = \FreeFW\Constants::TYPE_STRING;
        if (array_key_exists($field, $properties)) {
            $real = $source . '.' . $properties[$field][FFCST::PROPERTY_PRIVATE];
            $type = $properties[$field][FFCST::PROPERTY_TYPE];
        } else {
            throw new \FreeFW\Core\FreeFWStorageException(
                sprintf('Unknown field : %s !', $p_field)
            );
        }
        return [
            'id'    => $real,
            'value' => $p_field,
            'type'  => $type
        ];
    }
protected function renderModelField(string $p_field)
    {
        $parts = explode('.', $p_field);
        $class = $parts[0];
        $field = $parts[1];
        if (!array_key_exists($class, self::$models)) {
            self::$models[$class] = \FreeFW\DI\DI::get($class);
        }
        $model      = self::$models[$class];
        $source     = $model::getSource();
        $properties = $model::getProperties();
        $type       = \FreeFW\Constants::TYPE_STRING;
        if (array_key_exists($field, $properties)) {
            $real = $source . '.' . $properties[$field][FFCST::PROPERTY_PRIVATE];
            $type = $properties[$field][FFCST::PROPERTY_TYPE];
        } else {
            throw new \FreeFW\Core\FreeFWStorageException(
                sprintf('Unknown field : %s !', $p_field)
            );
        }
        return [
            'id'    => $real,
            'value' => $p_field,
            'type'  => $type
        ];
    }
protected function renderModelField ( string $ p_field ) { $ parts = explode ( '.' , $ p_field ) ; $ class = $ parts [ 0 ] ; $ field = $ parts [ 1 ] ; if ( ! array_key_exists ( $ class , self :: $ models ) ) { self :: $ models [ $ class ] = \ FreeFW \ DI \ DI :: get ( $ class ) ; } $ model = self :: $ models [ $ class ] ; $ source = $ model :: getSource ( ) ; $ properties = $ model :: getProperties ( ) ; $ type = \ FreeFW \ Constants :: TYPE_STRING ; if ( array_key_exists ( $ field , $ properties ) ) { $ real = $ source . '.' . $ properties [ $ field ] [ FFCST :: PROPERTY_PRIVATE ] ; $ type = $ properties [ $ field ] [ FFCST :: PROPERTY_TYPE ] ; } else { throw new \ FreeFW \ Core \ FreeFWStorageException ( sprintf ( 'Unknown field : %s !' , $ p_field ) ) ; } return [ 'id' => $ real , 'value' => $ p_field , 'type' => $ type ] ; }
Render a model field

@param string $p_field

@throws \FreeFW\Core\FreeFWStorageException
Render a model field