src/Charcoal/Property/StorablePropertyTrait.php
private function generateFields($val)
    {
        $this->fields = [];
        if ($this->l10n()) {
            foreach ($this->translator()->availableLocales() as $langCode) {
                $ident = $this->l10nIdent($langCode);
                $field = $this->createPropertyField([
                    'ident'       => $ident,
                    'sqlType'     => $this->sqlType(),
                    'sqlPdoType'  => $this->sqlPdoType(),
                    'sqlEncoding' => $this->sqlEncoding(),
                    'extra'       => $this->sqlExtra(),
                    'val'         => $this->fieldVal($langCode, $val),
                    'defaultVal'  => null,
                    'allowNull'   => $this->allowNull()
                ]);
                $this->fields[$langCode] = $field;
            }
        } else {
            $field = $this->createPropertyField([
                'ident'       => $this->ident(),
                'sqlType'     => $this->sqlType(),
                'sqlPdoType'  => $this->sqlPdoType(),
                'sqlEncoding' => $this->sqlEncoding(),
                'extra'       => $this->sqlExtra(),
                'val'         => $this->storageVal($val),
                'defaultVal'  => null,
                'allowNull'   => $this->allowNull()
            ]);
            $this->fields[] = $field;
        }

        return $this->fields;
    }
private function generateFields($val)
    {
        $this->fields = [];
        if ($this->l10n()) {
            foreach ($this->translator()->availableLocales() as $langCode) {
                $ident = $this->l10nIdent($langCode);
                $field = $this->createPropertyField([
                    'ident'       => $ident,
                    'sqlType'     => $this->sqlType(),
                    'sqlPdoType'  => $this->sqlPdoType(),
                    'sqlEncoding' => $this->sqlEncoding(),
                    'extra'       => $this->sqlExtra(),
                    'val'         => $this->fieldVal($langCode, $val),
                    'defaultVal'  => null,
                    'allowNull'   => $this->allowNull()
                ]);
                $this->fields[$langCode] = $field;
            }
        } else {
            $field = $this->createPropertyField([
                'ident'       => $this->ident(),
                'sqlType'     => $this->sqlType(),
                'sqlPdoType'  => $this->sqlPdoType(),
                'sqlEncoding' => $this->sqlEncoding(),
                'extra'       => $this->sqlExtra(),
                'val'         => $this->storageVal($val),
                'defaultVal'  => null,
                'allowNull'   => $this->allowNull()
            ]);
            $this->fields[] = $field;
        }

        return $this->fields;
    }
private function generateFields ( $ val ) { $ this -> fields = [ ] ; if ( $ this -> l10n ( ) ) { foreach ( $ this -> translator ( ) -> availableLocales ( ) as $ langCode ) { $ ident = $ this -> l10nIdent ( $ langCode ) ; $ field = $ this -> createPropertyField ( [ 'ident' => $ ident , 'sqlType' => $ this -> sqlType ( ) , 'sqlPdoType' => $ this -> sqlPdoType ( ) , 'sqlEncoding' => $ this -> sqlEncoding ( ) , 'extra' => $ this -> sqlExtra ( ) , 'val' => $ this -> fieldVal ( $ langCode , $ val ) , 'defaultVal' => null , 'allowNull' => $ this -> allowNull ( ) ] ) ; $ this -> fields [ $ langCode ] = $ field ; } } else { $ field = $ this -> createPropertyField ( [ 'ident' => $ this -> ident ( ) , 'sqlType' => $ this -> sqlType ( ) , 'sqlPdoType' => $ this -> sqlPdoType ( ) , 'sqlEncoding' => $ this -> sqlEncoding ( ) , 'extra' => $ this -> sqlExtra ( ) , 'val' => $ this -> storageVal ( $ val ) , 'defaultVal' => null , 'allowNull' => $ this -> allowNull ( ) ] ) ; $ this -> fields [ ] = $ field ; } return $ this -> fields ; }
Reset the property's storage fields.

@param  mixed $val The value to set as field value.
@return PropertyField[]
Reset the property s storage fields .