src/TableManipulationTrait.php
/**
     * Returns an array which can be used by the dbal insert, update and delete methods
     */
Returns an array which can be used by the dbal insert, update and delete methods
Returns an array which can be used by the dbal insert update and delete methods
protected function serializeFields(array $row): array
    {
        $data    = [];
        $columns = $this->getColumns();
        $builder = $this->newQueryBuilder($this->getName());
        $parts   = $builder->getQueryPart('from');
        $part    = reset($parts);
        $alias   = $part['alias'];
        foreach ($columns as $name => $type) {
            if (!empty($alias)) {
                $pos = strpos($name, $alias . '.');
                if ($pos !== false) {
                    $name = substr($name, strlen($alias) + 1);
                }
            }
            if (isset($row[$name])) {
                $data[$name] = $this->serializeType($row[$name], $type);
            }
        }
        return $data;
    }
protected function serializeFields ( array $ row ) : array { $ data = [ ] ; $ columns = $ this -> getColumns ( ) ; $ builder = $ this -> newQueryBuilder ( $ this -> getName ( ) ) ; $ parts = $ builder -> getQueryPart ( 'from' ) ; $ part = reset ( $ parts ) ; $ alias = $ part [ 'alias' ] ; foreach ( $ columns as $ name => $ type ) { if ( ! empty ( $ alias ) ) { $ pos = strpos ( $ name , $ alias . '.' ) ; if ( $ pos !== false ) { $ name = substr ( $ name , strlen ( $ alias ) + 1 ) ; } } if ( isset ( $ row [ $ name ] ) ) { $ data [ $ name ] = $ this -> serializeType ( $ row [ $ name ] , $ type ) ; } } return $ data ; }
Returns an array which can be used by the dbal insert, update and delete methods
Returns an array which can be used by the dbal insert update and delete methods